|
@@ -533,7 +533,7 @@ func capHandler(server *Server, client *Client, msg ircmsg.IrcMessage) bool {
|
533
|
533
|
switch subCommand {
|
534
|
534
|
case "LS":
|
535
|
535
|
if !client.registered {
|
536
|
|
- client.capState = CapNegotiating
|
|
536
|
+ client.capState = caps.NegotiatingState
|
537
|
537
|
}
|
538
|
538
|
if len(msg.Params) > 1 && msg.Params[1] == "302" {
|
539
|
539
|
client.capVersion = 302
|
|
@@ -549,7 +549,7 @@ func capHandler(server *Server, client *Client, msg ircmsg.IrcMessage) bool {
|
549
|
549
|
|
550
|
550
|
case "REQ":
|
551
|
551
|
if !client.registered {
|
552
|
|
- client.capState = CapNegotiating
|
|
552
|
+ client.capState = caps.NegotiatingState
|
553
|
553
|
}
|
554
|
554
|
|
555
|
555
|
// make sure all capabilities actually exist
|
|
@@ -564,7 +564,7 @@ func capHandler(server *Server, client *Client, msg ircmsg.IrcMessage) bool {
|
564
|
564
|
|
565
|
565
|
case "END":
|
566
|
566
|
if !client.registered {
|
567
|
|
- client.capState = CapNegotiated
|
|
567
|
+ client.capState = caps.NegotiatedState
|
568
|
568
|
server.tryRegister(client)
|
569
|
569
|
}
|
570
|
570
|
|
|
@@ -576,7 +576,7 @@ func capHandler(server *Server, client *Client, msg ircmsg.IrcMessage) bool {
|
576
|
576
|
|
577
|
577
|
// csHandler handles the /CS and /CHANSERV commands
|
578
|
578
|
func csHandler(server *Server, client *Client, msg ircmsg.IrcMessage) bool {
|
579
|
|
- server.chanservReceivePrivmsg(client, strings.Join(msg.Params, " "))
|
|
579
|
+ server.chanservPrivmsgHandler(client, strings.Join(msg.Params, " "))
|
580
|
580
|
return false
|
581
|
581
|
}
|
582
|
582
|
|
|
@@ -1676,7 +1676,7 @@ func nickHandler(server *Server, client *Client, msg ircmsg.IrcMessage) bool {
|
1676
|
1676
|
|
1677
|
1677
|
// NOTICE <target>{,<target>} <message>
|
1678
|
1678
|
func noticeHandler(server *Server, client *Client, msg ircmsg.IrcMessage) bool {
|
1679
|
|
- clientOnlyTags := GetClientOnlyTags(msg.Tags)
|
|
1679
|
+ clientOnlyTags := utils.GetClientOnlyTags(msg.Tags)
|
1680
|
1680
|
targets := strings.Split(msg.Params[0], ",")
|
1681
|
1681
|
message := msg.Params[1]
|
1682
|
1682
|
|
|
@@ -1710,10 +1710,10 @@ func noticeHandler(server *Server, client *Client, msg ircmsg.IrcMessage) bool {
|
1710
|
1710
|
continue
|
1711
|
1711
|
}
|
1712
|
1712
|
if target == "chanserv" {
|
1713
|
|
- server.chanservReceiveNotice(client, message)
|
|
1713
|
+ server.chanservNoticeHandler(client, message)
|
1714
|
1714
|
continue
|
1715
|
1715
|
} else if target == "nickserv" {
|
1716
|
|
- server.nickservReceiveNotice(client, message)
|
|
1716
|
+ server.nickservNoticeHandler(client, message)
|
1717
|
1717
|
continue
|
1718
|
1718
|
}
|
1719
|
1719
|
|
|
@@ -1778,7 +1778,7 @@ func npcaHandler(server *Server, client *Client, msg ircmsg.IrcMessage) bool {
|
1778
|
1778
|
|
1779
|
1779
|
// nsHandler handles the /NS and /NICKSERV commands
|
1780
|
1780
|
func nsHandler(server *Server, client *Client, msg ircmsg.IrcMessage) bool {
|
1781
|
|
- server.nickservReceivePrivmsg(client, strings.Join(msg.Params, " "))
|
|
1781
|
+ server.nickservPrivmsgHandler(client, strings.Join(msg.Params, " "))
|
1782
|
1782
|
return false
|
1783
|
1783
|
}
|
1784
|
1784
|
|
|
@@ -1901,7 +1901,7 @@ func pongHandler(server *Server, client *Client, msg ircmsg.IrcMessage) bool {
|
1901
|
1901
|
|
1902
|
1902
|
// PRIVMSG <target>{,<target>} <message>
|
1903
|
1903
|
func privmsgHandler(server *Server, client *Client, msg ircmsg.IrcMessage) bool {
|
1904
|
|
- clientOnlyTags := GetClientOnlyTags(msg.Tags)
|
|
1904
|
+ clientOnlyTags := utils.GetClientOnlyTags(msg.Tags)
|
1905
|
1905
|
targets := strings.Split(msg.Params[0], ",")
|
1906
|
1906
|
message := msg.Params[1]
|
1907
|
1907
|
|
|
@@ -1937,10 +1937,10 @@ func privmsgHandler(server *Server, client *Client, msg ircmsg.IrcMessage) bool
|
1937
|
1937
|
} else {
|
1938
|
1938
|
target, err = CasefoldName(targetString)
|
1939
|
1939
|
if target == "chanserv" {
|
1940
|
|
- server.chanservReceivePrivmsg(client, message)
|
|
1940
|
+ server.chanservPrivmsgHandler(client, message)
|
1941
|
1941
|
continue
|
1942
|
1942
|
} else if target == "nickserv" {
|
1943
|
|
- server.nickservReceivePrivmsg(client, message)
|
|
1943
|
+ server.nickservPrivmsgHandler(client, message)
|
1944
|
1944
|
continue
|
1945
|
1945
|
}
|
1946
|
1946
|
user := server.clients.Get(target)
|
|
@@ -2159,7 +2159,7 @@ func sceneHandler(server *Server, client *Client, msg ircmsg.IrcMessage) bool {
|
2159
|
2159
|
|
2160
|
2160
|
// TAGMSG <target>{,<target>}
|
2161
|
2161
|
func tagmsgHandler(server *Server, client *Client, msg ircmsg.IrcMessage) bool {
|
2162
|
|
- clientOnlyTags := GetClientOnlyTags(msg.Tags)
|
|
2162
|
+ clientOnlyTags := utils.GetClientOnlyTags(msg.Tags)
|
2163
|
2163
|
// no client-only tags, so we can drop it
|
2164
|
2164
|
if clientOnlyTags == nil {
|
2165
|
2165
|
return false
|