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

Method blockArrived

src/main/java/xmpp/extensions/IqRegister.java:28–51  ·  view source on GitHub ↗
(JabberDataBlock data)

Source from the content-addressed store, hash-verified

26 private RegistrationListener notifier;
27
28 public int blockArrived(JabberDataBlock data) {
29 if (data instanceof Iq) {
30 JabberDataBlock query = data.getChildBlock("query");
31 if (query == null) {
32 notifier.registrationSuccess();
33 return BLOCK_PROCESSED;
34 }
35 if (query.isJabberNameSpace(NS_REGS)) {
36 String type = data.getTypeAttribute();
37 if (type.equals("result")) {
38 String id = data.getAttribute("id");
39 if (id.startsWith("regac")) {
40 notifier.registrationFormNotify(data);
41 } else {
42 notifier.registrationSuccess();
43 }
44 } else if (type.equals("error")) {
45 notifier.registrationFailed(XmppError.findInStanza(data).toString());
46 }
47 return BLOCK_PROCESSED;
48 }
49 }
50 return BLOCK_REJECTED;
51 }
52
53 public interface RegistrationListener {
54 public void registrationFormNotify(JabberDataBlock data);

Callers

nothing calls this directly

Calls 10

isJabberNameSpaceMethod · 0.95
findInStanzaMethod · 0.95
getChildBlockMethod · 0.80
getTypeAttributeMethod · 0.80
registrationSuccessMethod · 0.65
registrationFailedMethod · 0.65
equalsMethod · 0.45
getAttributeMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected