()
| 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) { |
no test coverage detected