summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/com/isode/stroke/muc/MUC.java10
-rw-r--r--test/com/isode/stroke/muc/MockMUC.java3
2 files changed, 11 insertions, 2 deletions
diff --git a/src/com/isode/stroke/muc/MUC.java b/src/com/isode/stroke/muc/MUC.java
index 9806e34..19dbdd3 100644
--- a/src/com/isode/stroke/muc/MUC.java
+++ b/src/com/isode/stroke/muc/MUC.java
@@ -68,6 +68,14 @@ public abstract class MUC {
public abstract Map<String, MUCOccupant> getOccupants();
public abstract void changeNickname(final String newNickname);
public abstract void part();
+ /**
+ * Disconnect signals for this MUC.
+ * Java-specific method (not in Swiften) required so that any connected
+ * signals can be disconnected when the object is no longer required.
+ * While any signals are still connected, the MUC object will not be
+ * eligible for garbage collection.
+ */
+ public abstract void disconnect();
/*public abstract void handleIncomingMessage(Message::ref message); */
/** Expose public so it can be called when e.g. user goes offline */
public abstract void handleUserLeft(LeavingType l);
@@ -105,4 +113,4 @@ public abstract class MUC {
public final Signal onUnlocked = new Signal();
/* public final Signal1<MUCInfo> onInfoResult; */
/* public final Signal1<blah> onItemsResult; */
-} \ No newline at end of file
+}
diff --git a/test/com/isode/stroke/muc/MockMUC.java b/test/com/isode/stroke/muc/MockMUC.java
index 1b695d2..20c078b 100644
--- a/test/com/isode/stroke/muc/MockMUC.java
+++ b/test/com/isode/stroke/muc/MockMUC.java
@@ -88,6 +88,7 @@ public class MockMUC extends MUC {
public void changeNickname(final String newNickname) {}
public void part() {}
+ public void disconnect() {}
/*public void handleIncomingMessage(Message::ref message); */
/** Expose public so it can be called when e.g. user goes offline */
public void handleUserLeft(LeavingType l) {}
@@ -143,4 +144,4 @@ public class MockMUC extends MUC {
protected String getOwnNick() {
return ownMUCJID.getResource();
}
-} \ No newline at end of file
+}