diff --git a/internal/backends/memory/rooms.go b/internal/backends/memory/rooms.go index aa6e625..6e1c5be 100644 --- a/internal/backends/memory/rooms.go +++ b/internal/backends/memory/rooms.go @@ -20,6 +20,8 @@ type Room struct { events []RoomEvent + server *Backend + mutex sync.RWMutex } @@ -27,7 +29,7 @@ func (room *Room) ID() string { room.mutex.RLock() defer room.mutex.RUnlock() - return room.id + return "!" + room.id + ":" + room.server.hostname } func (room *Room) Name() string { diff --git a/internal/backends/memory/rooms_test.go b/internal/backends/memory/rooms_test.go index 5c31cf2..d71529f 100644 --- a/internal/backends/memory/rooms_test.go +++ b/internal/backends/memory/rooms_test.go @@ -26,6 +26,7 @@ func TestCreateRoom(t *testing.T) { assert.Equal(t, request.Topic, room.Topic()) assert.Equal(t, user.ID(), room.Creator().ID()) assert.Equal(t, 1, len(backend.rooms)) + assert.Equal(t, "!"+room.(*Room).id+":"+backend.hostname, room.ID()) } func TestCreateAlreadyExistingRoom(t *testing.T) {