mirror of
https://github.com/oxen-io/session-android.git
synced 2025-12-03 11:03:07 +00:00
Support for a "new messages" divider in conversations
// FREEBIE
This commit is contained in:
@@ -9,19 +9,29 @@ import org.thoughtcrime.securesms.util.AbstractCursorLoader;
|
||||
public class ConversationLoader extends AbstractCursorLoader {
|
||||
private final long threadId;
|
||||
private long limit;
|
||||
private long lastSeen;
|
||||
|
||||
public ConversationLoader(Context context, long threadId, long limit) {
|
||||
public ConversationLoader(Context context, long threadId, long limit, long lastSeen) {
|
||||
super(context);
|
||||
this.threadId = threadId;
|
||||
this.limit = limit;
|
||||
this.limit = limit;
|
||||
this.lastSeen = lastSeen;
|
||||
}
|
||||
|
||||
public boolean hasLimit() {
|
||||
return limit > 0;
|
||||
}
|
||||
|
||||
public long getLastSeen() {
|
||||
return lastSeen;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Cursor getCursor() {
|
||||
if (lastSeen == -1) {
|
||||
this.lastSeen = DatabaseFactory.getThreadDatabase(context).getLastSeen(threadId);
|
||||
}
|
||||
|
||||
return DatabaseFactory.getMmsSmsDatabase(context).getConversation(threadId, limit);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user