Changeset 142 in code for trunk/downstream.go


Ignore:
Timestamp:
Mar 25, 2020, 8:51:22 AM (5 years ago)
Author:
delthas
Message:

Add downstream self WHO and WHOIS support

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/downstream.go

    r141 r142  
    961961                entity := msg.Params[0]
    962962
     963                if entity == dc.nick {
     964                        // TODO: support AWAY (H/G) in self WHO reply
     965                        dc.SendMessage(&irc.Message{
     966                                Prefix:  dc.srv.prefix(),
     967                                Command: irc.RPL_WHOREPLY,
     968                                Params:  []string{dc.nick, "*", dc.username, dc.hostname, dc.srv.Hostname, dc.nick, "H", "0 " + dc.realname},
     969                        })
     970                        dc.SendMessage(&irc.Message{
     971                                Prefix:  dc.srv.prefix(),
     972                                Command: irc.RPL_ENDOFWHO,
     973                                Params:  []string{dc.nick, dc.nick, "End of /WHO list"},
     974                        })
     975                        return nil
     976                }
     977
    963978                uc, upstreamName, err := dc.unmarshalEntity(entity)
    964979                if err != nil {
     
    9961011                if i := strings.IndexByte(mask, ','); i >= 0 {
    9971012                        mask = mask[:i]
     1013                }
     1014
     1015                if mask == dc.nick {
     1016                        dc.SendMessage(&irc.Message{
     1017                                Prefix:  dc.srv.prefix(),
     1018                                Command: irc.RPL_WHOISUSER,
     1019                                Params:  []string{dc.nick, dc.nick, dc.username, dc.hostname, "*", dc.realname},
     1020                        })
     1021                        dc.SendMessage(&irc.Message{
     1022                                Prefix:  dc.srv.prefix(),
     1023                                Command: irc.RPL_WHOISSERVER,
     1024                                Params:  []string{dc.nick, dc.nick, dc.srv.Hostname, "soju"},
     1025                        })
     1026                        dc.SendMessage(&irc.Message{
     1027                                Prefix:  dc.srv.prefix(),
     1028                                Command: irc.RPL_ENDOFWHOIS,
     1029                                Params:  []string{dc.nick, dc.nick, "End of /WHOIS list"},
     1030                        })
     1031                        return nil
    9981032                }
    9991033
Note: See TracChangeset for help on using the changeset viewer.