Add oper classes, for more finely-grained control

This commit is contained in:
Daniel Oaks
2016-10-23 10:47:11 +10:00
parent a5395b5fe2
commit 64bdedaee2
5 changed files with 212 additions and 15 deletions
+8
View File
@@ -37,6 +37,7 @@ type Client struct {
capVersion CapVersion
certfp string
channels ChannelSet
class *OperClass
ctime time.Time
flags map[UserMode]bool
isDestroyed bool
@@ -50,6 +51,7 @@ type Client struct {
nickCasefolded string
nickMaskString string // cache for nickmask string since it's used with lots of replies
nickMaskCasefolded string
operName string
quitTimer *time.Timer
realname string
registered bool
@@ -347,6 +349,12 @@ func (client *Client) destroy() {
friends := client.Friends()
friends.Remove(client)
// remove from opers list
_, exists := client.server.currentOpers[client]
if exists {
delete(client.server.currentOpers, client)
}
// alert monitors
for _, mClient := range client.server.monitoring[client.nickCasefolded] {
mClient.Send(nil, client.server.name, RPL_MONOFFLINE, mClient.nick, client.nick)