MCPcopy Create free account
hub / github.com/BombusMod/BombusMod / blockArrived

Method blockArrived

src/main/java/Client/Groups.java:202–228  ·  view source on GitHub ↗
(JabberDataBlock data)

Source from the content-addressed store, hash-verified

200 }
201
202 public int blockArrived(JabberDataBlock data) {
203 if (data instanceof Iq) {
204 if (data.getTypeAttribute().equals("result")) {
205 JabberDataBlock query = data.findNamespace("query", "jabber:iq:private");
206 if (query == null) {
207 return BLOCK_REJECTED;
208 }
209 JabberDataBlock gs = query.findNamespace("gs", GROUPSTATE_NS);
210 if (gs == null || gs.getChildBlocks() == null) {
211 return BLOCK_REJECTED;
212 }
213 for (Enumeration e = gs.getChildBlocks().elements(); e.hasMoreElements();) {
214 JabberDataBlock item = (JabberDataBlock) e.nextElement();
215 String groupName = item.getText();
216 boolean collapsed = item.getAttribute("state").equals("collapsed");
217 Group grp = getGroup(groupName);
218 if (grp == null) {
219 continue;
220 }
221 grp.collapsed = collapsed;
222 }
223 sd.roster.reEnumRoster();
224 return NO_MORE_BLOCKS;
225 }
226 }
227 return BLOCK_REJECTED;
228 }
229
230 public void queryGroupState(boolean get) {
231 if (!sd.roster.isLoggedIn()) {

Callers

nothing calls this directly

Calls 9

findNamespaceMethod · 0.95
getChildBlocksMethod · 0.95
getTextMethod · 0.95
getAttributeMethod · 0.95
getGroupMethod · 0.95
getTypeAttributeMethod · 0.80
elementsMethod · 0.80
reEnumRosterMethod · 0.80
equalsMethod · 0.45

Tested by

no test coverage detected