mirror of
https://github.com/ergochat/ergo.git
synced 2024-12-22 10:42:52 +01:00
strip out the +a away mode
This commit is contained in:
parent
e387b7b328
commit
51465b4a3a
@ -315,10 +315,6 @@ In this section, we give an overview of the modes Oragono supports.
|
||||
|
||||
These are the modes which can be set on you when you're connected.
|
||||
|
||||
### +a - Away
|
||||
|
||||
If this mode is set, you're marked as 'away'. To set and unset this mode, you use the `/AWAY` command.
|
||||
|
||||
### +i - Invisible
|
||||
|
||||
If this mode is set, you're marked as 'invisible'. This means that your channels won't be shown when users `/WHOIS` you (except for IRC operators, they can see all the channels you're in).
|
||||
|
@ -1166,7 +1166,7 @@ func (channel *Channel) Invite(invitee *Client, inviter *Client, rb *ResponseBuf
|
||||
tnick := invitee.Nick()
|
||||
rb.Add(nil, inviter.server.name, RPL_INVITING, cnick, tnick, chname)
|
||||
invitee.Send(nil, inviter.NickMaskString(), "INVITE", tnick, chname)
|
||||
if invitee.HasMode(modes.Away) {
|
||||
if invitee.Away() {
|
||||
rb.Add(nil, inviter.server.name, RPL_AWAY, cnick, tnick, invitee.AwayMessage())
|
||||
}
|
||||
}
|
||||
|
@ -49,6 +49,7 @@ type Client struct {
|
||||
account string
|
||||
accountName string // display name of the account: uncasefolded, '*' if not logged in
|
||||
atime time.Time
|
||||
away bool
|
||||
awayMessage string
|
||||
certfp string
|
||||
channels ChannelSet
|
||||
|
@ -141,6 +141,22 @@ func (client *Client) Realname() string {
|
||||
return client.realname
|
||||
}
|
||||
|
||||
func (client *Client) Away() (result bool) {
|
||||
client.stateMutex.Lock()
|
||||
result = client.away
|
||||
client.stateMutex.Unlock()
|
||||
return
|
||||
}
|
||||
|
||||
func (client *Client) SetAway(away bool, awayMessage string) (changed bool) {
|
||||
client.stateMutex.Lock()
|
||||
changed = away != client.away
|
||||
client.away = away
|
||||
client.awayMessage = awayMessage
|
||||
client.stateMutex.Unlock()
|
||||
return
|
||||
}
|
||||
|
||||
// uniqueIdentifiers returns the strings for which the server enforces per-client
|
||||
// uniqueness/ownership; no two clients can have colliding casefolded nicks or
|
||||
// skeletons.
|
||||
|
@ -466,8 +466,7 @@ func awayHandler(server *Server, client *Client, msg ircmsg.IrcMessage, rb *Resp
|
||||
}
|
||||
}
|
||||
|
||||
client.SetMode(modes.Away, isAway)
|
||||
client.SetAwayMessage(awayMessage)
|
||||
client.SetAway(isAway, awayMessage)
|
||||
|
||||
if isAway {
|
||||
rb.Add(nil, server.name, RPL_NOWAWAY, client.nick, client.t("You have been marked as being away"))
|
||||
@ -2030,7 +2029,7 @@ func messageHandler(server *Server, client *Client, msg ircmsg.IrcMessage, rb *R
|
||||
session.sendSplitMsgFromClientInternal(false, now, nickMaskString, accountName, clientOnlyTags, msg.Command, tnick, splitMsg)
|
||||
}
|
||||
}
|
||||
if histType != history.Notice && user.HasMode(modes.Away) {
|
||||
if histType != history.Notice && user.Away() {
|
||||
//TODO(dan): possibly implement cooldown of away notifications to users
|
||||
rb.Add(nil, server.name, RPL_AWAY, cnick, tnick, user.AwayMessage())
|
||||
}
|
||||
@ -2499,7 +2498,7 @@ func userhostHandler(server *Server, client *Client, msg ircmsg.IrcMessage, rb *
|
||||
if target.HasMode(modes.Operator) {
|
||||
isOper = "*"
|
||||
}
|
||||
if target.HasMode(modes.Away) {
|
||||
if target.Away() {
|
||||
isAway = "-"
|
||||
} else {
|
||||
isAway = "+"
|
||||
|
@ -15,7 +15,7 @@ import (
|
||||
var (
|
||||
// SupportedUserModes are the user modes that we actually support (modifying).
|
||||
SupportedUserModes = Modes{
|
||||
Away, Bot, Invisible, Operator, RegisteredOnly, ServerNotice, UserRoleplaying,
|
||||
Bot, Invisible, Operator, RegisteredOnly, ServerNotice, UserRoleplaying,
|
||||
}
|
||||
|
||||
// SupportedChannelModes are the channel modes that we support.
|
||||
@ -107,7 +107,6 @@ func (modes Modes) String() string {
|
||||
|
||||
// User Modes
|
||||
const (
|
||||
Away Mode = 'a'
|
||||
Bot Mode = 'B'
|
||||
Invisible Mode = 'i'
|
||||
LocalOperator Mode = 'O'
|
||||
|
@ -75,7 +75,7 @@ func sendRoleplayMessage(server *Server, client *Client, source string, targetSt
|
||||
if rb.session.capabilities.Has(caps.EchoMessage) {
|
||||
rb.Add(nil, source, "PRIVMSG", tnick, message)
|
||||
}
|
||||
if user.HasMode(modes.Away) {
|
||||
if user.Away() {
|
||||
//TODO(dan): possibly implement cooldown of away notifications to users
|
||||
rb.Add(nil, server.name, RPL_AWAY, cnick, tnick, user.AwayMessage())
|
||||
}
|
||||
|
@ -548,7 +548,7 @@ func (target *Client) rplWhoReply(channel *Channel, client *Client, rb *Response
|
||||
channelName := "*"
|
||||
flags := ""
|
||||
|
||||
if client.HasMode(modes.Away) {
|
||||
if client.Away() {
|
||||
flags = "G"
|
||||
} else {
|
||||
flags = "H"
|
||||
|
Loading…
Reference in New Issue
Block a user