s/List/LIST/ when referring to the command
This commit is contained in:
parent
2ae43be525
commit
53d4f9f71b
@ -1113,7 +1113,7 @@ func (dc *downstreamConn) handleMessageRegistered(msg *irc.Message) error {
|
|||||||
Command: "LIST",
|
Command: "LIST",
|
||||||
Params: params,
|
Params: params,
|
||||||
}
|
}
|
||||||
uc.trySendList(dc.id)
|
uc.trySendLIST(dc.id)
|
||||||
})
|
})
|
||||||
case "NAMES":
|
case "NAMES":
|
||||||
if len(msg.Params) == 0 {
|
if len(msg.Params) == 0 {
|
||||||
|
14
upstream.go
14
upstream.go
@ -187,7 +187,7 @@ func (uc *upstreamConn) isChannel(entity string) bool {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
func (uc *upstreamConn) getPendingList() *pendingLIST {
|
func (uc *upstreamConn) getPendingLIST() *pendingLIST {
|
||||||
for _, pl := range uc.user.pendingLISTs {
|
for _, pl := range uc.user.pendingLISTs {
|
||||||
if _, ok := pl.pendingCommands[uc.network.ID]; !ok {
|
if _, ok := pl.pendingCommands[uc.network.ID]; !ok {
|
||||||
continue
|
continue
|
||||||
@ -197,7 +197,7 @@ func (uc *upstreamConn) getPendingList() *pendingLIST {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (uc *upstreamConn) endPendingLists(all bool) (found bool) {
|
func (uc *upstreamConn) endPendingLISTs(all bool) (found bool) {
|
||||||
found = false
|
found = false
|
||||||
for i := 0; i < len(uc.user.pendingLISTs); i++ {
|
for i := 0; i < len(uc.user.pendingLISTs); i++ {
|
||||||
pl := uc.user.pendingLISTs[i]
|
pl := uc.user.pendingLISTs[i]
|
||||||
@ -220,7 +220,7 @@ func (uc *upstreamConn) endPendingLists(all bool) (found bool) {
|
|||||||
if !all {
|
if !all {
|
||||||
delete(uc.pendingLISTDownstreamSet, pl.downstreamID)
|
delete(uc.pendingLISTDownstreamSet, pl.downstreamID)
|
||||||
uc.user.forEachUpstream(func(uc *upstreamConn) {
|
uc.user.forEachUpstream(func(uc *upstreamConn) {
|
||||||
uc.trySendList(pl.downstreamID)
|
uc.trySendLIST(pl.downstreamID)
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -228,7 +228,7 @@ func (uc *upstreamConn) endPendingLists(all bool) (found bool) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func (uc *upstreamConn) trySendList(downstreamID uint64) {
|
func (uc *upstreamConn) trySendLIST(downstreamID uint64) {
|
||||||
// must be called with a lock in uc.user.pendingLISTsLock
|
// must be called with a lock in uc.user.pendingLISTsLock
|
||||||
|
|
||||||
if _, ok := uc.pendingLISTDownstreamSet[downstreamID]; ok {
|
if _, ok := uc.pendingLISTDownstreamSet[downstreamID]; ok {
|
||||||
@ -958,7 +958,7 @@ func (uc *upstreamConn) handleMessage(msg *irc.Message) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
pl := uc.getPendingList()
|
pl := uc.getPendingLIST()
|
||||||
if pl == nil {
|
if pl == nil {
|
||||||
return fmt.Errorf("unexpected RPL_LIST: no matching pending LIST")
|
return fmt.Errorf("unexpected RPL_LIST: no matching pending LIST")
|
||||||
}
|
}
|
||||||
@ -971,7 +971,7 @@ func (uc *upstreamConn) handleMessage(msg *irc.Message) error {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
case irc.RPL_LISTEND:
|
case irc.RPL_LISTEND:
|
||||||
ok := uc.endPendingLists(false)
|
ok := uc.endPendingLISTs(false)
|
||||||
if !ok {
|
if !ok {
|
||||||
return fmt.Errorf("unexpected RPL_LISTEND: no matching pending LIST")
|
return fmt.Errorf("unexpected RPL_LISTEND: no matching pending LIST")
|
||||||
}
|
}
|
||||||
@ -1245,7 +1245,7 @@ func (uc *upstreamConn) handleMessage(msg *irc.Message) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if command == "LIST" {
|
if command == "LIST" {
|
||||||
ok := uc.endPendingLists(false)
|
ok := uc.endPendingLISTs(false)
|
||||||
if !ok {
|
if !ok {
|
||||||
return fmt.Errorf("unexpected response for LIST: %q: no matching pending LIST", msg.Command)
|
return fmt.Errorf("unexpected response for LIST: %q: no matching pending LIST", msg.Command)
|
||||||
}
|
}
|
||||||
|
2
user.go
2
user.go
@ -172,7 +172,7 @@ func (u *user) run() {
|
|||||||
for _, log := range uc.logs {
|
for _, log := range uc.logs {
|
||||||
log.file.Close()
|
log.file.Close()
|
||||||
}
|
}
|
||||||
uc.endPendingLists(true)
|
uc.endPendingLISTs(true)
|
||||||
case eventUpstreamMessage:
|
case eventUpstreamMessage:
|
||||||
msg, uc := e.msg, e.uc
|
msg, uc := e.msg, e.uc
|
||||||
if uc.isClosed() {
|
if uc.isClosed() {
|
||||||
|
Loading…
Reference in New Issue
Block a user