mirror of
https://github.com/signaller-matrix/signaller.git
synced 2024-11-05 02:01:03 +00:00
Fix SetTopic mutex infinity lock
This commit is contained in:
parent
f8c6a259e2
commit
4fc26f127e
@ -114,14 +114,16 @@ func (user *User) SetTopic(room internal.Room, topic string) models.ApiError {
|
||||
memRoom := room.(*Room)
|
||||
|
||||
memRoom.mutex.Lock()
|
||||
defer memRoom.mutex.Unlock()
|
||||
|
||||
if memRoom.creator.ID() != user.ID() { // TODO: currently only creator can change topic
|
||||
memRoom.mutex.Unlock()
|
||||
return models.NewError(models.M_FORBIDDEN, "")
|
||||
}
|
||||
|
||||
memRoom.topic = topic
|
||||
|
||||
memRoom.mutex.Unlock()
|
||||
|
||||
rEvent := &RoomEvent{
|
||||
Type: rooms.Topic,
|
||||
Sender: user,
|
||||
|
Loading…
Reference in New Issue
Block a user