Skip to content

Commit

Permalink
⚙️ room name is enough for topic
Browse files Browse the repository at this point in the history
  • Loading branch information
mudler committed Jan 22, 2022
1 parent 7968c5a commit 4167c68
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions pkg/hub/room.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ type Room struct {
// a Room on success.
func JoinRoom(ctx context.Context, ps *pubsub.PubSub, selfID peer.ID, roomName string) (*Room, error) {
// join the pubsub topic
topic, err := ps.Join(topicName(roomName))
topic, err := ps.Join(roomName)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -118,7 +118,3 @@ func (cr *Room) readLoop() {
cr.Messages <- cm
}
}

func topicName(roomName string) string {
return "chat-room:" + roomName
}

0 comments on commit 4167c68

Please sign in to comment.