3
0
mirror of https://github.com/ergochat/ergo.git synced 2024-11-22 20:09:41 +01:00

server: Add away-notify capability

This commit is contained in:
Daniel Oaks 2016-09-12 11:56:20 +10:00
parent 754b74c21c
commit 3321243486
3 changed files with 13 additions and 1 deletions

View File

@ -21,7 +21,7 @@ Initial release of Oragono!
* Added ability to parse complex mode change syntax commonly used these days (i.e. `+h-ov dan dan dan`).
* Added user mode for clients connected via TLS (`+Z`).
* Added ability to register and login to accounts (with passphrase or certfp).
* Added support for IRCv3 capabilities [`account-tag`](http://ircv3.net/specs/extensions/account-tag-3.2.html), [`extended-join`](http://ircv3.net/specs/extensions/extended-join-3.1.html), [`sasl`](http://ircv3.net/specs/extensions/sasl-3.1.html), [`server-time`](http://ircv3.net/specs/extensions/server-time-3.2.html), and [`userhost-in-names`](http://ircv3.net/specs/extensions/userhost-in-names-3.2.html).
* Added support for IRCv3 capabilities [`account-tag`](http://ircv3.net/specs/extensions/account-tag-3.2.html), [`away-notify`](http://ircv3.net/specs/extensions/away-notify-3.1.html), [`extended-join`](http://ircv3.net/specs/extensions/extended-join-3.1.html), [`sasl`](http://ircv3.net/specs/extensions/sasl-3.1.html), [`server-time`](http://ircv3.net/specs/extensions/server-time-3.2.html), and [`userhost-in-names`](http://ircv3.net/specs/extensions/userhost-in-names-3.2.html).
### Changed
* Changed channel creator (`O`) privilege to founder/admin/halfops (`qah`) privileges.

View File

@ -15,6 +15,7 @@ type Capability string
const (
AccountTag Capability = "account-tag"
AwayNotify Capability = "away-notify"
ExtendedJoin Capability = "extended-join"
MultiPrefix Capability = "multi-prefix"
SASL Capability = "sasl"
@ -25,6 +26,7 @@ const (
var (
SupportedCapabilities = CapabilitySet{
AccountTag: true,
AwayNotify: true,
ExtendedJoin: true,
MultiPrefix: true,
SASL: true,

View File

@ -830,6 +830,16 @@ func awayHandler(server *Server, client *Client, msg ircmsg.IrcMessage) bool {
op: op,
}}
client.Send(nil, server.nameString, "MODE", client.nickString, client.nickString, modech.String())
// dispatch away-notify
for friend := range client.Friends() {
if client.flags[Away] {
friend.SendFromClient(client, nil, client.nickMaskString, "AWAY", client.awayMessage)
} else {
friend.SendFromClient(client, nil, client.nickMaskString, "AWAY")
}
}
return false
}