Handle nick collisions by right-padding with _

This commit is contained in:
Ken-Håvard Lieng 2017-04-06 23:26:58 +02:00
parent 50dc0ef64f
commit 961c0415a0
8 changed files with 51 additions and 27 deletions

View file

@ -4,6 +4,8 @@ import (
"sync"
"time"
"fmt"
"github.com/khlieng/dispatch/irc"
"github.com/khlieng/dispatch/storage"
)
@ -125,6 +127,13 @@ func (s *Session) sendError(err error, server string) {
})
}
func (s *Session) print(server string, a ...interface{}) {
s.sendJSON("print", Chat{
Server: server,
Message: fmt.Sprintln(a...),
})
}
func (s *Session) resetExpirationIfEmpty() {
if s.numIRC() == 0 && s.numWS() == 0 {
s.reset <- AnonymousSessionExpiration