do not turn send button green unless history is caught up. fixes #1232
This commit is contained in:
parent
7cd4ed78b2
commit
5a5eb5bdd3
|
@ -102,6 +102,22 @@ public class MessageArchiveService implements OnAdvancedStreamFeaturesLoaded {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isCatchingUp(Conversation conversation) {
|
||||||
|
final Account account = conversation.getAccount();
|
||||||
|
if (account.getXmppConnection().isWaitingForSmCatchup()) {
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
synchronized (this.queries) {
|
||||||
|
for(Query query : this.queries) {
|
||||||
|
if (query.getAccount() == account && query.isCatchup() && ((conversation.getMode() == Conversation.MODE_SINGLE && query.getWith() == null) || query.getConversation() == conversation)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public Query query(final Conversation conversation, long end, boolean allowCatchup) {
|
public Query query(final Conversation conversation, long end, boolean allowCatchup) {
|
||||||
return this.query(conversation,conversation.getLastMessageTransmitted(),end, allowCatchup);
|
return this.query(conversation,conversation.getLastMessageTransmitted(),end, allowCatchup);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1275,9 +1275,10 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa
|
||||||
action = SendButtonAction.TEXT;
|
action = SendButtonAction.TEXT;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (activity.useSendButtonToIndicateStatus() && c != null
|
if (activity.useSendButtonToIndicateStatus() && c.getAccount().getStatus() == Account.State.ONLINE) {
|
||||||
&& c.getAccount().getStatus() == Account.State.ONLINE) {
|
if (activity.xmppConnectionService != null && activity.xmppConnectionService.getMessageArchiveService().isCatchingUp(c)) {
|
||||||
if (c.getMode() == Conversation.MODE_SINGLE) {
|
status = Presence.Status.OFFLINE;
|
||||||
|
} else if (c.getMode() == Conversation.MODE_SINGLE) {
|
||||||
status = c.getContact().getShownStatus();
|
status = c.getContact().getShownStatus();
|
||||||
} else {
|
} else {
|
||||||
status = c.getMucOptions().online() ? Presence.Status.ONLINE : Presence.Status.OFFLINE;
|
status = c.getMucOptions().online() ? Presence.Status.ONLINE : Presence.Status.OFFLINE;
|
||||||
|
|
Loading…
Reference in a new issue