(JabberDataBlock data)
| 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); |
nothing calls this directly
no test coverage detected