autoJoin.setSelection(MUCUtils.isOnAutoJoinList(MUCBrowserGUI.this.account,muc.getRoom()));
changeTopic.addListener(SWT.Selection,new Listener() {
public void handleEvent(Event event) {
InputDialog inputDialog = new InputDialog(txtTopic.getShell(),
"Change Subject",
"Enter a new Subject for the room " + muc.getRoom(),
txtTopic.getText(),
null);
int r = inputDialog.open();
if(r != InputDialog.OK) return;
try {
muc.changeSubject(inputDialog.getValue());
} catch (XMPPException e) {
e.printStackTrace();
String msg = e.getMessage();
if(e.getXMPPError() != null) {
msg = JabberErrorConditionMapping.getMeaning(e.getXMPPError().getCode());
if(e.getXMPPError().getMessage() != null)
msg = msg + " - " + e.getXMPPError().getMessage();
}
throw new RuntimeException(msg,e);
}
}
});
invite.addListener(SWT.Selection,new Listener() {
public void handleEvent(Event event) {
InputDialog inputDialog = new InputDialog(txtTopic.getShell(),
"Invite Someone",
"Enter JID of whom you want to invite to this Room (Afterwards you can enter an invite message)",
"",
null);
int r = inputDialog.open();
if(r != InputDialog.OK) return;
String jid = inputDialog.getValue();
inputDialog = new InputDialog(txtTopic.getShell(),
"Invite Someone",
"Enter Invite Message (Reason for the invitation)",
"Join me on " + muc.getRoom(),
null);
r = inputDialog.open();
if(r != InputDialog.OK) return;
String reason = inputDialog.getValue();
muc.invite(jid,reason);
}
});
autoJoin.addListener(SWT.Selection,new Listener() {
public void handleEvent(Event event) {