aboutsummaryrefslogtreecommitdiff
path: root/main/src/ui/unified_window_controller.vala
diff options
context:
space:
mode:
Diffstat (limited to 'main/src/ui/unified_window_controller.vala')
-rw-r--r--main/src/ui/unified_window_controller.vala9
1 files changed, 9 insertions, 0 deletions
diff --git a/main/src/ui/unified_window_controller.vala b/main/src/ui/unified_window_controller.vala
index bef6b7dc..ce15ecc9 100644
--- a/main/src/ui/unified_window_controller.vala
+++ b/main/src/ui/unified_window_controller.vala
@@ -142,6 +142,15 @@ public class UnifiedWindowController : Object {
}
}
+ public void loop_conversations(bool backwards = false) {
+ Gee.List<Conversation> conversations = stream_interactor.get_module(ConversationManager.IDENTITY).get_active_conversations();
+ conversations.sort((a, b) => { return b.last_active.compare(a.last_active); });
+ int index = conversations.index_of(this.conversation);
+ index += backwards ? -1 : 1;
+ select_conversation(conversations.get(index % conversations.size));
+ }
+
+
private void update_conversation_display_name() {
conversation_display_name = Util.get_conversation_display_name(stream_interactor, conversation);
}