diff options
| author | Marvin W <git@larma.de> | 2025-10-12 17:01:57 +0200 |
|---|---|---|
| committer | Marvin W <git@larma.de> | 2025-10-14 15:14:29 +0200 |
| commit | d0e8582565d347183e38bfeccfafeeba3f2d82cc (patch) | |
| tree | 2e5f4b1c28670b34fb4018a9149dfbe3a1f619f4 /libdino | |
| parent | 548fa150418f71622dd3e3f267af6bca0189c8f9 (diff) | |
Fix inconsistent values for conversation.active_last_changed
This could result in Dino not fetching the archive of rooms for the time an
account was disabled.
Diffstat (limited to 'libdino')
| -rw-r--r-- | libdino/src/entity/conversation.vala | 3 | ||||
| -rw-r--r-- | libdino/src/service/muc_manager.vala | 4 |
2 files changed, 5 insertions, 2 deletions
diff --git a/libdino/src/entity/conversation.vala b/libdino/src/entity/conversation.vala index 4115ae83..40943132 100644 --- a/libdino/src/entity/conversation.vala +++ b/libdino/src/entity/conversation.vala @@ -185,7 +185,8 @@ public class Conversation : Object { update.set(db.conversation.resource, nickname); break; case "active": update.set(db.conversation.active, active); - update.set(db.conversation.active_last_changed, (long) new DateTime.now_utc().to_unix()); + active_last_changed = new DateTime.now_utc(); + update.set(db.conversation.active_last_changed, (long) active_last_changed.to_unix()); break; case "last-active": if (last_active != null) { diff --git a/libdino/src/service/muc_manager.vala b/libdino/src/service/muc_manager.vala index ea02fdb5..5b251b07 100644 --- a/libdino/src/service/muc_manager.vala +++ b/libdino/src/service/muc_manager.vala @@ -43,7 +43,9 @@ public class MucManager : StreamInteractionModule, Object { stream_interactor.stream_negotiated.connect(on_stream_negotiated); stream_interactor.get_module(MessageProcessor.IDENTITY).received_pipeline.connect(received_message_listener); stream_interactor.get_module(ConversationManager.IDENTITY).conversation_deactivated.connect((conversation) => { - if (conversation.type_ == Conversation.Type.GROUPCHAT) { + // Conversation is still active if only the account is disabled. We don't need to part the room in this + // case, as we will just go offline instead. + if (conversation.type_ == Conversation.Type.GROUPCHAT && !conversation.active) { part(conversation.account, conversation.counterpart); } }); |
