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:
parent
754b74c21c
commit
3321243486
@ -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.
|
||||
|
@ -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,
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user