mirror of
https://github.com/jeremyd/ergo.git
synced 2026-07-02 06:48:55 -07:00
AWAY: Only dispatch AWAY when cap-notify is used
This commit is contained in:
+7
-1
@@ -255,11 +255,17 @@ func (c *Client) Id() string {
|
||||
}
|
||||
|
||||
// Friends refers to clients that share a channel with this client.
|
||||
func (client *Client) Friends() ClientSet {
|
||||
func (client *Client) Friends(Capabilities ...Capability) ClientSet {
|
||||
friends := make(ClientSet)
|
||||
friends.Add(client)
|
||||
for channel := range client.channels {
|
||||
for member := range channel.members {
|
||||
// make sure they have all the required caps
|
||||
for _, Cap := range Capabilities {
|
||||
if !member.capabilities[Cap] {
|
||||
continue
|
||||
}
|
||||
}
|
||||
friends.Add(member)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user