mirror of
https://github.com/ergochat/ergo.git
synced 2026-01-09 11:52:12 -08:00
AWAY: Only dispatch AWAY when cap-notify is used
This commit is contained in:
parent
e807f3ca04
commit
0eebd6273c
2 changed files with 8 additions and 2 deletions
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue