mirror of
https://github.com/ergochat/ergo.git
synced 2024-12-22 18:52:41 +01:00
remove all MODE +a / -a lines
as per discussion in #oragono, these are not sent by other servers
This commit is contained in:
parent
d6b22b925a
commit
b9501722a9
@ -469,29 +469,15 @@ func awayHandler(server *Server, client *Client, msg ircmsg.IrcMessage, rb *Resp
|
|||||||
client.SetMode(modes.Away, isAway)
|
client.SetMode(modes.Away, isAway)
|
||||||
client.SetAwayMessage(awayMessage)
|
client.SetAwayMessage(awayMessage)
|
||||||
|
|
||||||
var op modes.ModeOp
|
|
||||||
if isAway {
|
if isAway {
|
||||||
op = modes.Add
|
|
||||||
rb.Add(nil, server.name, RPL_NOWAWAY, client.nick, client.t("You have been marked as being away"))
|
rb.Add(nil, server.name, RPL_NOWAWAY, client.nick, client.t("You have been marked as being away"))
|
||||||
} else {
|
} else {
|
||||||
op = modes.Remove
|
|
||||||
rb.Add(nil, server.name, RPL_UNAWAY, client.nick, client.t("You are no longer marked as being away"))
|
rb.Add(nil, server.name, RPL_UNAWAY, client.nick, client.t("You are no longer marked as being away"))
|
||||||
}
|
}
|
||||||
//TODO(dan): Should this be sent automagically as part of setting the flag/mode?
|
|
||||||
modech := modes.ModeChanges{modes.ModeChange{
|
|
||||||
Mode: modes.Away,
|
|
||||||
Op: op,
|
|
||||||
}}
|
|
||||||
|
|
||||||
details := client.Details()
|
|
||||||
modeString := modech.String()
|
|
||||||
rb.Add(nil, server.name, "MODE", details.nick, modeString)
|
|
||||||
|
|
||||||
// dispatch away-notify
|
// dispatch away-notify
|
||||||
|
details := client.Details()
|
||||||
for session := range client.Friends(caps.AwayNotify) {
|
for session := range client.Friends(caps.AwayNotify) {
|
||||||
if session != rb.session && rb.session.client == session.client {
|
|
||||||
session.Send(nil, server.name, "MODE", details.nick, modeString)
|
|
||||||
}
|
|
||||||
if isAway {
|
if isAway {
|
||||||
session.sendFromClientInternal(false, time.Time{}, "", details.nickMask, details.account, nil, "AWAY", awayMessage)
|
session.sendFromClientInternal(false, time.Time{}, "", details.nickMask, details.account, nil, "AWAY", awayMessage)
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user