diff options
author | Alex Auvolat <alex@adnab.me> | 2020-02-17 15:30:01 +0100 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2020-02-17 15:30:01 +0100 |
commit | c740f76826c0291005111c8554c256e8f491e7b9 (patch) | |
tree | 32ca1e98591d3c8afeaba124eb2c872800a058c9 /appservice/db.go | |
parent | 51f3c45e05558153880f1b6898be86e84e76a5a1 (diff) | |
download | easybridge-c740f76826c0291005111c8554c256e8f491e7b9.tar.gz easybridge-c740f76826c0291005111c8554c256e8f491e7b9.zip |
Handle users leaving from rooms
Diffstat (limited to 'appservice/db.go')
-rw-r--r-- | appservice/db.go | 18 |
1 files changed, 18 insertions, 0 deletions
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 + } +} |