aboutsummaryrefslogtreecommitdiff
path: root/libdino/src/service
diff options
context:
space:
mode:
authorfiaxh <git@mx.ax.lt>2017-12-17 13:15:53 +0100
committerfiaxh <git@mx.ax.lt>2017-12-30 13:10:06 +0100
commit8cbc4e7f892e08cc18552e6a41fc752c22e082ba (patch)
treedeb14de2e5bac14f111d8148e46f641a97dd43fc /libdino/src/service
parentb4bb0912fc328bc44b13e190f59b347eb5d4310a (diff)
downloaddino-8cbc4e7f892e08cc18552e6a41fc752c22e082ba.tar.gz
dino-8cbc4e7f892e08cc18552e6a41fc752c22e082ba.zip
Clear chat states on own/contact disconnect
fixes #197
Diffstat (limited to 'libdino/src/service')
-rw-r--r--libdino/src/service/counterpart_interaction_manager.vala2
1 files changed, 2 insertions, 0 deletions
diff --git a/libdino/src/service/counterpart_interaction_manager.vala b/libdino/src/service/counterpart_interaction_manager.vala
index bde60889..e4207a1c 100644
--- a/libdino/src/service/counterpart_interaction_manager.vala
+++ b/libdino/src/service/counterpart_interaction_manager.vala
@@ -27,9 +27,11 @@ public class CounterpartInteractionManager : StreamInteractionModule, Object {
stream_interactor.account_added.connect(on_account_added);
stream_interactor.get_module(MessageProcessor.IDENTITY).message_received.connect(on_message_received);
stream_interactor.get_module(MessageProcessor.IDENTITY).message_sent.connect(check_if_got_marker);
+ stream_interactor.stream_negotiated.connect(() => chat_states.clear() );
}
public string? get_chat_state(Account account, Jid jid) {
+ if (stream_interactor.connection_manager.get_state(account) != ConnectionManager.ConnectionState.CONNECTED) return null;
return chat_states[jid];
}