dms kind work

This commit is contained in:
Karmanyaah Malhotra
2021-04-30 17:21:13 -04:00
parent e2daccc250
commit 23c5e89c4f
5 changed files with 46 additions and 9 deletions

View File

@@ -150,7 +150,10 @@ func (store *SQLStateStore) TryGetMember(roomID id.RoomID, userID id.UserID) (*e
}
func (store *SQLStateStore) TryGetMemberRaw(roomID id.RoomID, userID id.UserID) (user MxUserProfile, err bool) {
ans := store.db.Where("room_id = ? AND user_id = ?", roomID, userID).Limit(1).Find(&user)
user.RoomID = roomID.String()
user.UserID = userID.String()
ans := store.db.Limit(1).Find(&user)
if ans.Error == gorm.ErrRecordNotFound {
err = true