mirror of
https://github.com/signaller-matrix/signaller.git
synced 2024-11-22 02:12:20 +00:00
Fix room.ID() method
This commit is contained in:
parent
b27c537374
commit
a05a6dfb54
@ -20,6 +20,8 @@ type Room struct {
|
|||||||
|
|
||||||
events []RoomEvent
|
events []RoomEvent
|
||||||
|
|
||||||
|
server *Backend
|
||||||
|
|
||||||
mutex sync.RWMutex
|
mutex sync.RWMutex
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -27,7 +29,7 @@ func (room *Room) ID() string {
|
|||||||
room.mutex.RLock()
|
room.mutex.RLock()
|
||||||
defer room.mutex.RUnlock()
|
defer room.mutex.RUnlock()
|
||||||
|
|
||||||
return room.id
|
return "!" + room.id + ":" + room.server.hostname
|
||||||
}
|
}
|
||||||
|
|
||||||
func (room *Room) Name() string {
|
func (room *Room) Name() string {
|
||||||
|
@ -26,6 +26,7 @@ func TestCreateRoom(t *testing.T) {
|
|||||||
assert.Equal(t, request.Topic, room.Topic())
|
assert.Equal(t, request.Topic, room.Topic())
|
||||||
assert.Equal(t, user.ID(), room.Creator().ID())
|
assert.Equal(t, user.ID(), room.Creator().ID())
|
||||||
assert.Equal(t, 1, len(backend.rooms))
|
assert.Equal(t, 1, len(backend.rooms))
|
||||||
|
assert.Equal(t, "!"+room.(*Room).id+":"+backend.hostname, room.ID())
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestCreateAlreadyExistingRoom(t *testing.T) {
|
func TestCreateAlreadyExistingRoom(t *testing.T) {
|
||||||
|
Loading…
Reference in New Issue
Block a user