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

Method send

src/main/java/Client/MessageEdit.java:332–385  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

330//# }
331//#endif
332 private void send() {
333 if (cf.autoScroll) {
334 to.moveToLatest = true;
335 }
336
337 String comp = null; // composing event off
338
339 String id = String.valueOf((int) System.currentTimeMillis());
340
341 if (body != null) {
342 body = body.trim();
343 }
344 if (body != null || subj != null) {
345//#ifdef DETRANSLIT
346 if (sendInTranslit == true) {
347 if (body != null) {
348 body = util.DeTranslit.getInstance().translit(body);
349 }
350 if (subj != null) {
351 subj = util.DeTranslit.getInstance().translit(subj);
352 }
353 }
354 if (sendInDeTranslit == true || cf.autoDeTranslit) {
355 if (body != null) {
356 body = util.DeTranslit.getInstance().deTranslit(body);
357 }
358 if (subj != null) {
359 subj = util.DeTranslit.getInstance().deTranslit(subj);
360 }
361 }
362//#endif
363 String from = sd.account.toString();
364 Msg msg = new Msg(Msg.MESSAGE_TYPE_OUT, from, subj, body);
365 msg.id = id;
366
367 if (to.origin != Contact.ORIGIN_GROUPCHAT) {
368 to.addMessage(msg);
369 comp = "active"; // composing event in message
370 }
371 } else if (to.acceptComposing) {
372 comp = (composing) ? "composing" : "paused";
373 }
374 if (!cf.eventComposing) {
375 comp = null;
376 }
377 try {
378 if (body != null || subj != null || comp != null) {
379 to.lastSendedMessage = body;
380 sd.roster.sendMessage(to, id, body, subj, comp);
381 }
382 } catch (Exception e) {
383 sd.roster.errorLog(e.getMessage());
384 }
385 }
386
387 /* Пролистывание команд по страницам, для SE C510
388 private void addCommand(Command cmd) {

Callers 15

showMethod · 0.95
commandActionMethod · 0.95
QueryRequestVoiceMethod · 0.45
cmdOkMethod · 0.45
QueryConfigFormMethod · 0.45
XDataFormSubmitMethod · 0.45
listRqMethod · 0.45
setMucModMethod · 0.45
queryGroupStateMethod · 0.45
sendPresenceMethod · 0.45
sendDirectPresenceMethod · 0.45

Calls 8

translitMethod · 0.80
deTranslitMethod · 0.80
sendMessageMethod · 0.80
errorLogMethod · 0.80
getInstanceMethod · 0.45
toStringMethod · 0.45
addMessageMethod · 0.45
getMessageMethod · 0.45

Tested by

no test coverage detected