aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/thedevstack/conversationsplus/ui/listeners/ConversationMoreMessagesLoadedListener.java
diff options
context:
space:
mode:
authorsteckbrief <steckbrief@chefmail.de>2015-12-06 16:20:11 +0100
committersteckbrief <steckbrief@chefmail.de>2015-12-06 16:20:11 +0100
commiteb5a7a5392ec93976d91d5576a3496ceac473d03 (patch)
tree8b43e53a205df0e24ddcdf12f905b7381a7ea411 /src/main/java/de/thedevstack/conversationsplus/ui/listeners/ConversationMoreMessagesLoadedListener.java
parent0086d5dc80dd95b1e8e4dcfe2d3d3090d260bb88 (diff)
Fix flagging no more messages on server for conversation
Diffstat (limited to 'src/main/java/de/thedevstack/conversationsplus/ui/listeners/ConversationMoreMessagesLoadedListener.java')
-rw-r--r--src/main/java/de/thedevstack/conversationsplus/ui/listeners/ConversationMoreMessagesLoadedListener.java13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/main/java/de/thedevstack/conversationsplus/ui/listeners/ConversationMoreMessagesLoadedListener.java b/src/main/java/de/thedevstack/conversationsplus/ui/listeners/ConversationMoreMessagesLoadedListener.java
index 774e72ba..859a6069 100644
--- a/src/main/java/de/thedevstack/conversationsplus/ui/listeners/ConversationMoreMessagesLoadedListener.java
+++ b/src/main/java/de/thedevstack/conversationsplus/ui/listeners/ConversationMoreMessagesLoadedListener.java
@@ -29,16 +29,24 @@ public class ConversationMoreMessagesLoadedListener implements XmppConnectionSer
The current loading status
*/
private boolean loadingMessages = false;
+ /**
+ * Whether the user is loading only history messages or not.
+ * History messages are messages which are older than the oldest in the database.
+ */
+ private boolean loadHistory = true;
public ConversationMoreMessagesLoadedListener(SwipyRefreshLayout swipeLayout, List<Message> messageList, ConversationFragment fragment, ListView messagesView, MessageAdapter messageListAdapter) {
this.swipeLayout = swipeLayout;
this.messageList = messageList;
-
this.fragment = fragment;
this.messagesView = messagesView;
this.messageListAdapter = messageListAdapter;
}
+ public void setLoadHistory(boolean value) {
+ this.loadHistory = value;
+ }
+
public void setLoadingInProgress() {
this.loadingMessages = true;
}
@@ -62,6 +70,9 @@ public class ConversationMoreMessagesLoadedListener implements XmppConnectionSer
}
// No new messages are loaded
if (0 == c) {
+ if (this.loadHistory) {
+ conversation.setHasMessagesLeftOnServer(false);
+ }
activity.runOnUiThread(new Runnable() {
@Override
public void run() {