(Msg m)
| 109 | } |
| 110 | |
| 111 | private byte[] getBodyBytes(Msg m) { |
| 112 | String fromName = StaticData.getInstance().account.JID.getNode(); |
| 113 | if (m.messageType != Msg.MESSAGE_TYPE_OUT) { |
| 114 | fromName = m.from; |
| 115 | } |
| 116 | |
| 117 | StringBuffer body = new StringBuffer(); |
| 118 | |
| 119 | int marker = MESSAGE_MARKER_OTHER; |
| 120 | switch (m.messageType) { |
| 121 | case Msg.MESSAGE_TYPE_IN: |
| 122 | marker = MESSAGE_MARKER_IN; |
| 123 | break; |
| 124 | case Msg.MESSAGE_TYPE_PRESENCE: |
| 125 | marker = MESSAGE_MARKER_PRESENCE; |
| 126 | break; |
| 127 | case Msg.MESSAGE_TYPE_OUT: |
| 128 | marker = MESSAGE_MARKER_OUT; |
| 129 | } |
| 130 | |
| 131 | body.append(MS).append(TS).append(marker).append(TE).append(DS) |
| 132 | .append(m.getDayTime()).append(DE).append(FS) |
| 133 | .append(StringUtils.escapeTags(fromName)).append(FE); |
| 134 | if (m.subject != null) { |
| 135 | body.append(SS).append(StringUtils.escapeTags(m.subject)).append(SE); |
| 136 | } |
| 137 | body.append(BS).append(StringUtils.escapeTags(m.body)).append(BE).append(ME).append(RN); |
| 138 | |
| 139 | return Strconv.toUTFArray(body.toString()); |
| 140 | } |
| 141 | } |
| 142 | |
| 143 | //#endif |
no test coverage detected