aboutsummaryrefslogtreecommitdiff
path: root/appservice/db.go
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2020-02-17 15:30:01 +0100
committerAlex Auvolat <alex@adnab.me>2020-02-17 15:30:01 +0100
commitc740f76826c0291005111c8554c256e8f491e7b9 (patch)
tree32ca1e98591d3c8afeaba124eb2c872800a058c9 /appservice/db.go
parent51f3c45e05558153880f1b6898be86e84e76a5a1 (diff)
downloadeasybridge-c740f76826c0291005111c8554c256e8f491e7b9.tar.gz
easybridge-c740f76826c0291005111c8554c256e8f491e7b9.zip
Handle users leaving from rooms
Diffstat (limited to 'appservice/db.go')
-rw-r--r--appservice/db.go18
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
+ }
+}