commit 71786a2b723039b31c7a4b8de2f6ecdec0cee904 parent 0f4fc3f1ca956f4450396ce78ea3e007d1127935 Author: n0tr1v <n0tr1v@protonmail.com> Date: Thu, 10 Nov 2022 12:46:04 -0800 add utils IsOwned fn for room Diffstat:
| M | pkg/database/tableChatRooms.go | | | 5 | +++++ |
1 file changed, 5 insertions(+), 0 deletions(-)
diff --git a/pkg/database/tableChatRooms.go b/pkg/database/tableChatRooms.go @@ -38,6 +38,11 @@ func CreateRoom(name string, passwordHash string, ownerID int64, isListed bool) return } +// IsOwned returns either or not a user created the room +func (r *ChatRoom) IsOwned() bool { + return r.OwnerUserID != nil +} + func (r *ChatRoom) IsProtected() bool { return r.Password != "" }