Advertisement
Guest User

Untitled

a guest
Sep 26th, 2017
414
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.22 KB | None | 0 0
  1. Index: Client/Contact.java
  2. ===================================================================
  3. --- Client/Contact.java (revision 1039)
  4. +++ Client/Contact.java (working copy)
  5. @@ -338,18 +338,27 @@
  6.  
  7. public void addMessage(Msg m) {
  8. boolean last_replace = false;
  9. - if (origin != ORIGIN_GROUPCHAT) {
  10. - if (msgs.size() > 0 && m.isPresence()) {
  11. + if (origin == ORIGIN_GROUPCHAT) {
  12. + /*if (msgs.size() > 0 && m.isPresence()) {
  13. Object item = msgs.lastElement();
  14. if (item != null) {
  15. if (((MessageItem) item).msg.isPresence()) {
  16. last_replace = true;
  17. }
  18. }
  19. - } else {
  20. + } else {*/
  21. if (cf.showNickNames && m.messageType != Msg.MESSAGE_TYPE_PRESENCE) {
  22. StringBuffer who = new StringBuffer();
  23. - who.append((m.messageType == Msg.MESSAGE_TYPE_OUT) ? sd.account.getNickName() : getName()).append(" (").append(m.getTime()).append(") ");
  24. + Contact c=StaticData.getInstance().roster.getContact(m.from, true);
  25. + String nickName = c.getName();
  26. +//#if NICK_COLORS
  27. + who.append("\01");
  28. +//#endif
  29. + who.append(nickName);//.append(" (").append(m.getTime()).append("):");
  30. +//#if NICK_COLORS
  31. + who.append("\02");
  32. +//#endif
  33. + who.append(" (").append(m.getTime()).append("):");
  34. if (m.subject != null) {
  35. who.append("\n").append(m.subject);
  36. }
  37. @@ -357,10 +366,12 @@
  38. }
  39. if (m.body.startsWith("/me ")) {
  40. StringBuffer b = new StringBuffer();
  41. + Contact c=StaticData.getInstance().roster.getContact(m.from, true);
  42. + String nickName = c.getName();
  43. //#if NICK_COLORS
  44. b.append("\01");
  45. //#endif
  46. - b.append((m.messageType == Msg.MESSAGE_TYPE_OUT) ? sd.account.getNickName() : getName());
  47. + b.append(nickName);
  48. //#if NICK_COLORS
  49. b.append("\02");
  50. //#endif
  51. @@ -369,7 +380,7 @@
  52. m.body = b.toString();
  53. b = null;
  54. }
  55. - }
  56. + //}
  57. } else {
  58. status = Presence.PRESENCE_ONLINE;
  59. //#ifdef LOGROTATE
  60. Index: Client/Roster.java
  61. ===================================================================
  62. --- Client/Roster.java (revision 1039)
  63. +++ Client/Roster.java (working copy)
  64. @@ -1464,7 +1464,7 @@
  65. //#endif
  66. if (name==null) name=c.getName();
  67. // /me
  68. - if (body!=null) {
  69. + /*if (body!=null) {
  70. //forme=false;
  71. if (body.startsWith("/me ")) start_me=3;
  72. if (start_me>=0) {
  73. @@ -1487,7 +1487,7 @@
  74. b=null;
  75. }
  76.  
  77. - }
  78. + }*/
  79. //boolean compose=false;
  80. if (type.equals("chat") && myStatus!=Presence.PRESENCE_INVISIBLE) {
  81. if (message.findNamespace("request", "urn:xmpp:receipts")!=null) {
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement