summaryrefslogtreecommitdiffstats
path: root/src/com
diff options
context:
space:
mode:
Diffstat (limited to 'src/com')
-rw-r--r--src/com/isode/stroke/elements/Message.java10
-rw-r--r--src/com/isode/stroke/elements/Stanza.java12
-rw-r--r--src/com/isode/stroke/muc/MUC.java2
-rw-r--r--src/com/isode/stroke/muc/MUCBookmark.java8
4 files changed, 20 insertions, 12 deletions
diff --git a/src/com/isode/stroke/elements/Message.java b/src/com/isode/stroke/elements/Message.java
index 5cfb58f..7760ff5 100644
--- a/src/com/isode/stroke/elements/Message.java
+++ b/src/com/isode/stroke/elements/Message.java
@@ -1,9 +1,5 @@
/*
- * Copyright (c) 2010, Isode Limited, London, England.
- * All rights reserved.
- */
-/*
- * Copyright (c) 2010, Remko Tronçon.
+ * Copyright (c) 2010-2015, Isode Limited, London, England.
* All rights reserved.
*/
package com.isode.stroke.elements;
@@ -24,6 +20,10 @@ public class Message extends Stanza {
}
return "";
}
+
+ public boolean hasSubject() {
+ return getPayload(new Subject()) != null;
+ }
public void setSubject(String subject) {
updatePayload(new Subject(subject));
diff --git a/src/com/isode/stroke/elements/Stanza.java b/src/com/isode/stroke/elements/Stanza.java
index 9a4b907..8a5aadd 100644
--- a/src/com/isode/stroke/elements/Stanza.java
+++ b/src/com/isode/stroke/elements/Stanza.java
@@ -172,4 +172,16 @@ public abstract class Stanza implements Element {
Delay delay = getPayload(new Delay());
return delay != null ? delay.getStamp() : null;
}
+
+ public Date getTimestampFrom(final JID jid) {
+ Vector<Delay> delays = getPayloads(new Delay());
+ for (int i = 0; i < delays.size(); ++i) {
+ Delay delay = delays.get(i);
+ if (delay.getFrom().equals(jid)) {
+ return delay.getStamp();
+ }
+ }
+ return getTimestamp();
+ }
+
}
diff --git a/src/com/isode/stroke/muc/MUC.java b/src/com/isode/stroke/muc/MUC.java
index 900bb7d..ed3c34a 100644
--- a/src/com/isode/stroke/muc/MUC.java
+++ b/src/com/isode/stroke/muc/MUC.java
@@ -625,7 +625,7 @@ public class MUC {
return ownMUCJID.compare(j, CompareType.WithoutResource) == 0;
}
- private void handleUserLeft(LeavingType type) {
+ public void handleUserLeft(LeavingType type) {
String resource = ownMUCJID.getResource();
if (occupants.containsKey(resource)) {
MUCOccupant me = occupants.get(resource);
diff --git a/src/com/isode/stroke/muc/MUCBookmark.java b/src/com/isode/stroke/muc/MUCBookmark.java
index 64f3d9d..42b9dff 100644
--- a/src/com/isode/stroke/muc/MUCBookmark.java
+++ b/src/com/isode/stroke/muc/MUCBookmark.java
@@ -1,9 +1,5 @@
/*
- * Copyright (c) 2012, Isode Limited, London, England.
- * All rights reserved.
- */
-/*
- * Copyright (c) 2010, Remko Tronçon.
+ * Copyright (c) 2010-2015, Isode Limited, London, England.
* All rights reserved.
*/
@@ -42,7 +38,7 @@ public class MUCBookmark {
* @param room room jabber id, not null
* @param bookmarkName name of bookmark, can be null
*/
- MUCBookmark(JID room, String bookmarkName) {
+ public MUCBookmark(JID room, String bookmarkName) {
this.room_ = room;
this.name_ = bookmarkName;
this.autojoin_ = false;