aboutsummaryrefslogtreecommitdiff
path: root/libdino/src/service/chat_interaction.vala
diff options
context:
space:
mode:
Diffstat (limited to 'libdino/src/service/chat_interaction.vala')
-rw-r--r--libdino/src/service/chat_interaction.vala15
1 files changed, 10 insertions, 5 deletions
diff --git a/libdino/src/service/chat_interaction.vala b/libdino/src/service/chat_interaction.vala
index 4ec8e243..1e86ccf4 100644
--- a/libdino/src/service/chat_interaction.vala
+++ b/libdino/src/service/chat_interaction.vala
@@ -131,7 +131,7 @@ public class ChatInteraction : StreamInteractionModule, Object {
}
private void check_send_read() {
- if (selected_conversation == null || selected_conversation.type_ == Conversation.Type.GROUPCHAT) return;
+ if (selected_conversation == null) return;
Entities.Message? message = stream_interactor.get_module(MessageStorage.IDENTITY).get_last_message(selected_conversation);
if (message != null && message.direction == Entities.Message.DIRECTION_RECEIVED && !message.equals(selected_conversation.read_up_to)) {
selected_conversation.read_up_to = message;
@@ -197,17 +197,22 @@ public class ChatInteraction : StreamInteractionModule, Object {
XmppStream? stream = stream_interactor.get_stream(conversation.account);
if (stream == null) return;
- if (message.stanza_id == null) return; // Need a stanza id to mark
-
switch (marker) {
case Xep.ChatMarkers.MARKER_RECEIVED:
- if (stanza != null && Xep.ChatMarkers.Module.requests_marking(stanza)) {
+ if (stanza != null && Xep.ChatMarkers.Module.requests_marking(stanza) && message.type_ != Message.Type.GROUPCHAT) {
+ if (message.stanza_id == null) return;
stream.get_module(Xep.ChatMarkers.Module.IDENTITY).send_marker(stream, message.from, message.stanza_id, message.get_type_string(), Xep.ChatMarkers.MARKER_RECEIVED);
}
break;
case Xep.ChatMarkers.MARKER_DISPLAYED:
if (conversation.get_send_marker_setting(stream_interactor) == Conversation.Setting.ON) {
- stream.get_module(Xep.ChatMarkers.Module.IDENTITY).send_marker(stream, message.from, message.stanza_id, message.get_type_string(), Xep.ChatMarkers.MARKER_DISPLAYED);
+ if (message.type_ == Message.Type.GROUPCHAT) {
+ if (message.stanza_id == null) return;
+ stream.get_module(Xep.ChatMarkers.Module.IDENTITY).send_marker(stream, message.from.bare_jid, message.server_id, message.get_type_string(), Xep.ChatMarkers.MARKER_DISPLAYED);
+ } else {
+ if (message.stanza_id == null) return;
+ stream.get_module(Xep.ChatMarkers.Module.IDENTITY).send_marker(stream, message.from, message.stanza_id, message.get_type_string(), Xep.ChatMarkers.MARKER_DISPLAYED);
+ }
}
break;
}