forked from External/ergo
draft/resume-0.2 implementation, message history support
This commit is contained in:
parent
70364f5f67
commit
a0bf548fc5
28 changed files with 1294 additions and 317 deletions
|
|
@ -81,6 +81,24 @@ 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