diff options
Diffstat (limited to 'src/com')
4 files changed, 13 insertions, 7 deletions
diff --git a/src/com/isode/stroke/roster/RosterPushResponder.java b/src/com/isode/stroke/roster/RosterPushResponder.java index 18b20b5..515df82 100644 --- a/src/com/isode/stroke/roster/RosterPushResponder.java +++ b/src/com/isode/stroke/roster/RosterPushResponder.java @@ -13,7 +13,7 @@ import com.isode.stroke.signals.Signal1; public class RosterPushResponder extends SetResponder<RosterPayload> { - final Signal1<RosterPayload> onRosterReceived = new Signal1<RosterPayload>(); + public final Signal1<RosterPayload> onRosterReceived = new Signal1<RosterPayload>(); public RosterPushResponder(IQRouter router) { super(new RosterPayload(), router); diff --git a/src/com/isode/stroke/roster/XMPPRoster.java b/src/com/isode/stroke/roster/XMPPRoster.java index a2c3cd3..ce5ecc5 100644 --- a/src/com/isode/stroke/roster/XMPPRoster.java +++ b/src/com/isode/stroke/roster/XMPPRoster.java @@ -13,6 +13,12 @@ import com.isode.stroke.signals.Signal; import com.isode.stroke.signals.Signal1; import com.isode.stroke.signals.Signal3; +/** + * This class represents the roster of an account, as stored on the XMPP server. + * + * Changes to the roster (either due to subscription requests or by going online/offline) are + * emitted through signals. + */ public abstract class XMPPRoster { /** * Checks whether the bare jid of the given jid is in the roster. diff --git a/src/com/isode/stroke/roster/XMPPRosterController.java b/src/com/isode/stroke/roster/XMPPRosterController.java index 6ad03f2..b6ac35a 100644 --- a/src/com/isode/stroke/roster/XMPPRosterController.java +++ b/src/com/isode/stroke/roster/XMPPRosterController.java @@ -70,7 +70,7 @@ public class XMPPRosterController { rosterRequest.send(); } - void handleRosterReceived(RosterPayload rosterPayload, boolean initial, RosterPayload previousRoster) { + private void handleRosterReceived(RosterPayload rosterPayload, boolean initial, RosterPayload previousRoster) { if (rosterPayload != null) { for (final RosterItemPayload item : rosterPayload.getItems()) { //Don't worry about the updated case, the XMPPRoster sorts that out. @@ -100,7 +100,7 @@ public class XMPPRosterController { } } - void saveRoster(final String version) { + private void saveRoster(final String version) { Collection<XMPPRosterItem> items = xmppRoster_.getItems(); RosterPayload roster = new RosterPayload(); roster.setVersion(version); diff --git a/src/com/isode/stroke/roster/XMPPRosterImpl.java b/src/com/isode/stroke/roster/XMPPRosterImpl.java index 61d0bc3..d87a20e 100644 --- a/src/com/isode/stroke/roster/XMPPRosterImpl.java +++ b/src/com/isode/stroke/roster/XMPPRosterImpl.java @@ -19,7 +19,7 @@ public class XMPPRosterImpl extends XMPPRoster { private Map<JID, XMPPRosterItem> entries_ = new HashMap<JID, XMPPRosterItem>(); - void addContact(final JID jid, final String name, final Collection<String> groups, RosterItemPayload.Subscription subscription) { + public void addContact(final JID jid, final String name, final Collection<String> groups, RosterItemPayload.Subscription subscription) { JID bareJID = jid.toBare(); XMPPRosterItem item = entries_.get(bareJID); @@ -35,19 +35,19 @@ public class XMPPRosterImpl extends XMPPRoster { } } - void removeContact(final JID jid) { + public void removeContact(final JID jid) { entries_.remove(jid.toBare()); onJIDRemoved.emit(jid); } - void clear() { + public void clear() { entries_.clear(); onRosterCleared.emit(); } @Override public boolean containsJID(JID jid) { - return entries_.containsKey(jid); + return entries_.containsKey(jid.toBare()); } @Override |