mirror of
https://github.com/ergochat/ergo.git
synced 2025-12-20 02:00:11 -08:00
implement draft/resume-0.4
This commit is contained in:
parent
eaf0328608
commit
3d445573cf
15 changed files with 442 additions and 343 deletions
|
|
@ -77,24 +77,6 @@ func (manager *MonitorManager) Remove(client *Client, nick string) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
func (manager *MonitorManager) Resume(newClient, oldClient *Client) error {
|
||||
manager.Lock()
|
||||
defer manager.Unlock()
|
||||
|
||||
// newClient is now watching everyone oldClient was watching
|
||||
oldTargets := manager.watching[oldClient]
|
||||
delete(manager.watching, oldClient)
|
||||
manager.watching[newClient] = oldTargets
|
||||
|
||||
// update watchedby as well
|
||||
for watchedNick := range oldTargets {
|
||||
delete(manager.watchedby[watchedNick], oldClient)
|
||||
manager.watchedby[watchedNick][newClient] = true
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// RemoveAll unregisters `client` from receiving notifications about *all* nicks.
|
||||
func (manager *MonitorManager) RemoveAll(client *Client) {
|
||||
manager.Lock()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue