(JabberDataBlock xmuc, Presence presence)
| 80 | } |
| 81 | |
| 82 | public String processPresence(JabberDataBlock xmuc, Presence presence) { |
| 83 | String from=jid.toString(); |
| 84 | |
| 85 | int presenceType=presence.getTypeIndex(); |
| 86 | |
| 87 | if (presenceType==Presence.PRESENCE_ERROR) { |
| 88 | StaticData.getInstance().roster.roomOffline(group); |
| 89 | return StringUtils.processError(presence, presenceType, (ConferenceGroup) group, this); |
| 90 | } |
| 91 | |
| 92 | JabberDataBlock item=xmuc.getChildBlock("item"); |
| 93 | |
| 94 | String tempRole=item.getAttribute("role"); |
| 95 | if (tempRole.equals("visitor")) roleCode=ROLE_VISITOR; |
| 96 | else if (tempRole.equals("participant")) roleCode=ROLE_PARTICIPANT; |
| 97 | else if (tempRole.equals("moderator")) roleCode=ROLE_MODERATOR; |
| 98 | |
| 99 | String tempAffiliation=item.getAttribute("affiliation"); |
| 100 | if (tempAffiliation.equals("owner")) affiliationCode=AFFILIATION_OWNER; |
| 101 | else if (tempAffiliation.equals("admin")) affiliationCode=AFFILIATION_ADMIN; |
| 102 | else if (tempAffiliation.equals("member")) affiliationCode=AFFILIATION_MEMBER; |
| 103 | else if (tempAffiliation.equals("none")) affiliationCode=AFFILIATION_NONE; |
| 104 | |
| 105 | boolean roleChanged= !tempRole.equals(role); |
| 106 | boolean affiliationChanged=!tempAffiliation.equals(affiliation); |
| 107 | role=tempRole; |
| 108 | affiliation=tempAffiliation; |
| 109 | |
| 110 | setSortKey(nick); |
| 111 | |
| 112 | switch (roleCode) { |
| 113 | case ROLE_MODERATOR: |
| 114 | transport=RosterIcons.ICON_MODERATOR_INDEX; |
| 115 | key0=GROUP_MODERATOR; |
| 116 | break; |
| 117 | case ROLE_VISITOR: |
| 118 | transport=RosterIcons.getInstance().getTransportIndex("muc#vis"); |
| 119 | key0=GROUP_VISITOR; |
| 120 | break; |
| 121 | default: |
| 122 | transport=(affiliation.equals("member"))? 0: RosterIcons.getInstance().getTransportIndex("muc#vis"); |
| 123 | key0=(affiliation.equals("member"))?GROUP_MEMBER:GROUP_PARTICIPANT; |
| 124 | } |
| 125 | |
| 126 | int statusCode = 0; |
| 127 | |
| 128 | JabberDataBlock statusBlock = xmuc.getChildBlock("status"); |
| 129 | if (statusBlock != null) { |
| 130 | try { |
| 131 | statusCode = Integer.parseInt(statusBlock.getAttribute("code")); |
| 132 | } catch (NumberFormatException e) { |
| 133 | } |
| 134 | } |
| 135 | |
| 136 | StringBuffer b=new StringBuffer(); |
| 137 | Msg.appendNick(b,nick); |
| 138 | |
| 139 | String statusText=presence.getChildBlockText("status"); |
no test coverage detected