properly update mailbox, fixes #9

This commit is contained in:
Aine
2022-08-28 09:37:18 +03:00
parent 6eae1a65c4
commit 13776ad7a6
3 changed files with 25 additions and 15 deletions

View File

@@ -78,20 +78,6 @@ func (b *Bot) Start(statusMsg string) error {
return b.lp.Start(statusMsg)
}
// GetMappings returns mapping of mailbox = room
func (b *Bot) GetMapping(mailbox string) (id.RoomID, bool) {
v, ok := b.rooms.Load(mailbox)
if !ok {
return "", ok
}
roomID, ok := v.(id.RoomID)
if !ok {
return "", ok
}
return roomID, ok
}
// Stop the bot
func (b *Bot) Stop() {
err := b.lp.GetClient().SetPresence(event.PresenceOffline)