aboutsummaryrefslogtreecommitdiff
path: root/main/src/ui
diff options
context:
space:
mode:
authorbobufa <bobufa@users.noreply.github.com>2018-07-22 16:58:51 +0200
committerbobufa <bobufa@users.noreply.github.com>2018-08-13 22:39:18 +0200
commit4901b096708ff5ca54c3e5393de74f2a8be55894 (patch)
treed92993706cb1527228508971898e6be57da3a979 /main/src/ui
parent2e2a9a239000509488f1a369ea4eaf4cdda9c0b1 (diff)
downloaddino-4901b096708ff5ca54c3e5393de74f2a8be55894.tar.gz
dino-4901b096708ff5ca54c3e5393de74f2a8be55894.zip
add search filter expressions
Diffstat (limited to 'main/src/ui')
-rw-r--r--main/src/ui/unified_window.vala11
1 files changed, 11 insertions, 0 deletions
diff --git a/main/src/ui/unified_window.vala b/main/src/ui/unified_window.vala
index e5444f9d..cfcd2bff 100644
--- a/main/src/ui/unified_window.vala
+++ b/main/src/ui/unified_window.vala
@@ -42,6 +42,17 @@ public class UnifiedWindow : Window {
conversation_titlebar.search_button.bind_property("active", search_revealer, "reveal-child", BindingFlags.SYNC_CREATE | BindingFlags.BIDIRECTIONAL);
search_revealer.notify["child-revealed"].connect(() => {
if (search_revealer.child_revealed) {
+ if (conversation_frame.conversation != null) {
+ switch (conversation_frame.conversation.type_) {
+ case Conversation.Type.CHAT:
+ case Conversation.Type.GROUPCHAT_PM:
+ search_box.search_entry.text = @"with:$(conversation_frame.conversation.counterpart) ";
+ break;
+ case Conversation.Type.GROUPCHAT:
+ search_box.search_entry.text = @"in:$(conversation_frame.conversation.counterpart) ";
+ break;
+ }
+ }
search_box.search_entry.grab_focus();
} else {
search_box.search_entry.text = "";