prepend server name to room id in order to make ids unique across server connections

This commit is contained in:
Zlatin Balevsky
2019-11-13 13:44:22 +00:00
parent 73f1d64428
commit 38eb89f2f7
3 changed files with 5 additions and 4 deletions

View File

@@ -72,7 +72,7 @@ class ChatRoomController {
params['host'] = model.host
params['roomTabName'] = newRoom
mvcGroup.parentGroup.createMVCGroup("chat-room", newRoom, params)
mvcGroup.parentGroup.createMVCGroup("chat-room", model.host.getHumanReadableName()+"-"+newRoom, params)
}
}
if (command.action == ChatAction.LEAVE && !model.console) {

View File

@@ -97,7 +97,7 @@ class ChatServerModel {
}
if (chatCommand.action == ChatAction.SAY &&
room == core.me.toBase64()) {
String groupId = e.sender.getHumanReadableName() + "-private-chat"
String groupId = host.getHumanReadableName()+"-"+e.sender.getHumanReadableName() + "-private-chat"
if (!mvcGroup.childrenGroups.containsKey(groupId)) {
def params = [:]
params['core'] = core
@@ -110,7 +110,8 @@ class ChatServerModel {
mvcGroup.createMVCGroup("chat-room",groupId, params)
}
room = groupId
}
} else
room = host.getHumanReadableName()+"-"+room
mvcGroup.childrenGroups[room]?.controller?.handleChatMessage(e)
}

View File

@@ -69,7 +69,7 @@ class ChatServerView {
params['roomTabName'] = 'Console'
params['console'] = true
params['host'] = model.host
mvcGroup.createMVCGroup("chat-room",ChatServer.CONSOLE, params)
mvcGroup.createMVCGroup("chat-room",model.host.getHumanReadableName()+"-"+ChatServer.CONSOLE, params)
}
def closeTab = {