MCPcopy Index your code
hub / github.com/BombusMod/BombusMod / cmdOk

Method cmdOk

src/main/java/Account/AccountForm.java:234–294  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

232 }
233
234 public void cmdOk() {
235 String user = userbox.getValue().trim().toLowerCase();
236 String pass = passbox.getValue();
237 String resource = StaticData.getInstance().getVersionInfo().NAME;
238 if (resourcebox != null)
239 resource = resourcebox.getValue();
240 String server = "";
241 int at = user.indexOf('@');
242 if (at > -1) {
243 server = user.substring(at + 1);
244 user = user.substring(0, at);
245 }
246 if (server.length() == 0 || user.length() == 0 || pass.length() == 0) {
247 new AlertBox(SR.MS_LOGIN_FAILED, SR.MS_LOGIN_FAILED) {
248 @Override
249 public void yes() {
250 destroyView();
251 }
252
253 @Override
254 public void no() {
255 destroyView();
256 }
257 };
258 return;
259 }
260
261 item.account.JID = new Jid(user, server, resource);
262 item.account.password = pass;
263 item.account.nick = nickbox.getValue();
264
265 if (showExtended) {
266 String hostname = ipbox.getValue();
267 item.account.port = Integer.parseInt(portbox.getValue());
268 item.account.hostAddr = hostname;
269 item.account.plainAuth = plainPwdbox.getValue();
270 item.account.compression = compressionBox.getValue();
271//#ifndef WMUC
272 item.account.mucOnly = confOnlybox.getValue();
273//#endif
274 item.account.setEnableProxy(proxybox.getValue());
275
276 item.account.proxyHostAddr = proxyHost.getValue();
277 item.account.setProxyPort(Integer.parseInt(proxyPort.getValue()));
278
279 item.account.setProxyUser(proxyUser.getValue());
280 item.account.setProxyPass(proxyPass.getValue());
281//#ifndef HTTPBIND
282 item.account.keepAlivePeriod = Integer.parseInt(keepAlive.getValue());
283//#endif
284 }
285
286 if (newaccount) {
287 accountSelect.itemsList.addElement(item);
288 }
289 accountSelect.rmsUpdate();
290 accountSelect.commandState();
291

Callers 1

doActionMethod · 0.95

Calls 12

getInstanceMethod · 0.95
destroyViewMethod · 0.95
toLowerCaseMethod · 0.80
getVersionInfoMethod · 0.80
setEnableProxyMethod · 0.80
setProxyPortMethod · 0.80
setProxyUserMethod · 0.80
setProxyPassMethod · 0.80
addElementMethod · 0.80
commandStateMethod · 0.65
getValueMethod · 0.45
rmsUpdateMethod · 0.45

Tested by

no test coverage detected