From c740f76826c0291005111c8554c256e8f491e7b9 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Mon, 17 Feb 2020 15:30:01 +0100 Subject: Handle users leaving from rooms --- appservice/db.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'appservice/db.go') diff --git a/appservice/db.go b/appservice/db.go index cbd1d11..e5b2d02 100644 --- a/appservice/db.go +++ b/appservice/db.go @@ -182,3 +182,21 @@ func dbGetMxUser(protocol string, userId connector.UserID) (string, error) { return user.MxUserID, nil } + +func dbIsPmRoom(mxRoomId string) *DbPmRoomMap { + var pm_room DbPmRoomMap + if db.First(&pm_room, DbPmRoomMap{MxRoomID: mxRoomId}).RecordNotFound() { + return nil + } else { + return &pm_room + } +} + +func dbIsPublicRoom(mxRoomId string) *DbRoomMap { + var room DbRoomMap + if db.First(&room, DbRoomMap{MxRoomID: mxRoomId}).RecordNotFound() { + return nil + } else { + return &room + } +} -- cgit v1.2.3