2016-08-14 21:48:51 +02:00
|
|
|
package birc
|
2016-07-11 21:23:33 +02:00
|
|
|
|
|
|
|
import (
|
|
|
|
"strings"
|
|
|
|
)
|
|
|
|
|
2017-07-14 00:35:01 +02:00
|
|
|
/*
|
2016-07-11 21:23:33 +02:00
|
|
|
func tableformatter(nicks []string, nicksPerRow int, continued bool) string {
|
|
|
|
result := "|IRC users"
|
|
|
|
if continued {
|
|
|
|
result = "|(continued)"
|
|
|
|
}
|
|
|
|
for i := 0; i < 2; i++ {
|
|
|
|
for j := 1; j <= nicksPerRow && j <= len(nicks); j++ {
|
|
|
|
if i == 0 {
|
|
|
|
result += "|"
|
|
|
|
} else {
|
|
|
|
result += ":-|"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
result += "\r\n|"
|
|
|
|
}
|
|
|
|
result += nicks[0] + "|"
|
|
|
|
for i := 1; i < len(nicks); i++ {
|
|
|
|
if i%nicksPerRow == 0 {
|
|
|
|
result += "\r\n|" + nicks[i] + "|"
|
|
|
|
} else {
|
|
|
|
result += nicks[i] + "|"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return result
|
|
|
|
}
|
2017-07-14 00:35:01 +02:00
|
|
|
*/
|
2016-07-11 21:23:33 +02:00
|
|
|
|
2018-11-08 00:29:30 +01:00
|
|
|
func plainformatter(nicks []string) string {
|
2016-07-11 21:23:33 +02:00
|
|
|
return strings.Join(nicks, ", ") + " currently on IRC"
|
|
|
|
}
|
|
|
|
|
|
|
|
func IsMarkup(message string) bool {
|
|
|
|
switch message[0] {
|
|
|
|
case '|':
|
|
|
|
fallthrough
|
|
|
|
case '#':
|
|
|
|
fallthrough
|
|
|
|
case '_':
|
|
|
|
fallthrough
|
|
|
|
case '*':
|
|
|
|
fallthrough
|
|
|
|
case '~':
|
|
|
|
fallthrough
|
|
|
|
case '-':
|
|
|
|
fallthrough
|
|
|
|
case ':':
|
|
|
|
fallthrough
|
|
|
|
case '>':
|
|
|
|
fallthrough
|
|
|
|
case '=':
|
|
|
|
return true
|
|
|
|
}
|
|
|
|
return false
|
|
|
|
}
|