connection code

This commit is contained in:
Zlatin Balevsky
2019-11-11 23:52:34 +00:00
parent 8ebae1600b
commit 146ed53e12

View File

@@ -442,7 +442,23 @@ class MainFrameController {
@ControllerAction
void connectChatServer() {
String address = JOptionPane.showInputDialog("Copy/paste the address of the server here")
if (address == null)
return
Persona p
try {
p = new Persona(new ByteArrayInputStream(Base64.decode(address)))
} catch (Exception bad) {
JOptionPane.showMessageDialog(null, "Invalid server address", "Invalid server address", JOptionPane.ERROR_MESSAGE)
return
}
if (!mvcGroup.getChildrenGroups().containsKey(p.getHumanReadableName())) {
def params = [:]
params['core'] = model.core
params['host'] = p
mvcGroup.createMVCGroup("chat-server", p.getHumanReadableName(), params)
}
}
void saveMuWireSettings() {