aboutsummaryrefslogtreecommitdiff
path: root/server.go
diff options
context:
space:
mode:
Diffstat (limited to 'server.go')
-rw-r--r--server.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/server.go b/server.go
index 55b6789..f3eb898 100644
--- a/server.go
+++ b/server.go
@@ -151,18 +151,18 @@ func handleTxnEvent(e *mxlib.Event) error {
ms := e.Content["membership"].(string)
if ms == "leave" {
if pm_room := dbIsPmRoom(e.RoomId); pm_room != nil {
- // If leaving a PM room, we must delete it
+ // If user leaves a PM room, we must drop it
+ dbDeletePmRoom(pm_room)
them_mx := userMxId(pm_room.Protocol, pm_room.UserID)
mx.RoomLeaveAs(e.RoomId, them_mx)
- db.Delete(pm_room)
return nil
} else if room := dbIsPublicRoom(e.RoomId); room != nil {
// If leaving a public room, leave from server as well
acct := FindJoinedAccount(e.Sender, room.Protocol, room.RoomID)
if acct != nil {
acct.Conn.Leave(room.RoomID)
+ acct.delAutojoin(room.RoomID)
return nil
- // TODO: manage autojoin list, remove this room
} else {
mx.RoomKick(e.RoomId, e.Sender, fmt.Sprintf("Not present in %s on %s, please talk with Easybridge to rejoin", room.RoomID, room.Protocol))
return fmt.Errorf("not joined %s on %s", room.RoomID, room.Protocol)