aboutsummaryrefslogtreecommitdiff
path: root/libdino/src/service/counterpart_interaction_manager.vala
diff options
context:
space:
mode:
authorfiaxh <git@lightrise.org>2020-05-28 00:27:06 +0200
committerfiaxh <git@lightrise.org>2020-06-03 21:50:40 +0200
commitd01af5b520d112b00e4c18b16657f89d5afe7ad4 (patch)
treec32a343766e72f95d2d67b456b41b66872e8cdfe /libdino/src/service/counterpart_interaction_manager.vala
parent71be2abb6a007fd9b4ed3164d70f5cb95d49ce69 (diff)
downloaddino-d01af5b520d112b00e4c18b16657f89d5afe7ad4.tar.gz
dino-d01af5b520d112b00e4c18b16657f89d5afe7ad4.zip
Fix compiler warnings
Diffstat (limited to 'libdino/src/service/counterpart_interaction_manager.vala')
-rw-r--r--libdino/src/service/counterpart_interaction_manager.vala12
1 files changed, 5 insertions, 7 deletions
diff --git a/libdino/src/service/counterpart_interaction_manager.vala b/libdino/src/service/counterpart_interaction_manager.vala
index 1e5fd0e2..7a98f0ff 100644
--- a/libdino/src/service/counterpart_interaction_manager.vala
+++ b/libdino/src/service/counterpart_interaction_manager.vala
@@ -54,7 +54,7 @@ public class CounterpartInteractionManager : StreamInteractionModule, Object {
public Gee.List<Jid>? get_typing_jids(Conversation conversation) {
if (stream_interactor.connection_manager.get_state(conversation.account) != ConnectionManager.ConnectionState.CONNECTED) return null;
- if (!typing_since.contains(conversation) || typing_since[conversation].size == 0) return null;
+ if (!typing_since.has_key(conversation) || typing_since[conversation].size == 0) return null;
var jids = new ArrayList<Jid>();
foreach (Jid jid in typing_since[conversation].keys) {
@@ -65,7 +65,7 @@ public class CounterpartInteractionManager : StreamInteractionModule, Object {
private void on_account_added(Account account) {
stream_interactor.module_manager.get_module(account, Xep.ChatMarkers.Module.IDENTITY).marker_received.connect( (stream, jid, marker, id, message_stanza) => {
- on_chat_marker_received(account, jid, marker, id, message_stanza);
+ on_chat_marker_received.begin(account, jid, marker, id, message_stanza);
});
stream_interactor.module_manager.get_module(account, Xep.MessageDeliveryReceipts.Module.IDENTITY).receipt_received.connect((stream, jid, id) => {
on_receipt_received(account, jid, id);
@@ -76,7 +76,7 @@ public class CounterpartInteractionManager : StreamInteractionModule, Object {
}
private void clear_chat_state(Conversation conversation, Jid jid) {
- if (!(typing_since.contains(conversation) && typing_since[conversation].contains(jid))) return;
+ if (!(typing_since.has_key(conversation) && typing_since[conversation].has_key(jid))) return;
typing_since[conversation].unset(jid);
received_state(conversation, Xmpp.Xep.ChatStateNotifications.STATE_ACTIVE);
@@ -85,9 +85,7 @@ public class CounterpartInteractionManager : StreamInteractionModule, Object {
private void clear_all_chat_states(Account account) {
foreach (Conversation conversation in typing_since.keys) {
if (conversation.account.equals(account)) {
- foreach (Jid jid in typing_since[conversation].keys) {
- received_state(conversation, Xmpp.Xep.ChatStateNotifications.STATE_ACTIVE);
- }
+ received_state(conversation, Xmpp.Xep.ChatStateNotifications.STATE_ACTIVE);
typing_since[conversation].clear();
}
}
@@ -155,7 +153,7 @@ public class CounterpartInteractionManager : StreamInteractionModule, Object {
ContentItem? content_item = stream_interactor.get_module(ContentItemStore.IDENTITY).get_item(conversation, 1, message.id);
ContentItem? read_up_to_item = stream_interactor.get_module(ContentItemStore.IDENTITY).get_item_by_id(conversation, conversation.read_up_to_item);
- if (read_up_to_item != null && read_up_to_item.sort_time.compare(content_item.sort_time) > 0) return;
+ if (read_up_to_item != null && read_up_to_item.compare(content_item) > 0) return;
conversation.read_up_to_item = content_item.id;
} else {
// We can't currently handle chat markers in MUCs