about summary refs log tree commit diff stats
path: root/src/ui
diff options
context:
space:
mode:
authorMichael Vetter <jubalh@iodoru.org>2021-05-08 19:33:58 +0200
committerMichael Vetter <jubalh@iodoru.org>2021-05-08 19:38:40 +0200
commit1d8061e89b23f896035fdd62e777dd9343b35bb5 (patch)
tree0cf9969d157e282d0a2cc14048806e18a49bb248 /src/ui
parent1ef700f918f706da2098460ead880b2538aaf262 (diff)
downloadprofani-tty-1d8061e89b23f896035fdd62e777dd9343b35bb5.tar.gz
Have separate settings for intype
Old: `/intype on|of`
Typing information is printed in console and titlebar.

New: `/intype titlebar|console on|off`
Typing information can be configured in more detail.

Regards https://github.com/profanity-im/profanity/issues/1516
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/console.c9
-rw-r--r--src/ui/core.c18
2 files changed, 18 insertions, 9 deletions
diff --git a/src/ui/console.c b/src/ui/console.c
index 9f4d6248..3eff47d5 100644
--- a/src/ui/console.c
+++ b/src/ui/console.c
@@ -1716,9 +1716,14 @@ void
 cons_intype_setting(void)
 {
     if (prefs_get_boolean(PREF_INTYPE))
-        cons_show("Show typing (/intype)         : ON");
+        cons_show("Show typing in titlebar (/intype titlebar)       : ON");
     else
-        cons_show("Show typing (/intype)         : OFF");
+        cons_show("Show typing in titlebar (/intype titlebar)       : OFF");
+
+    if (prefs_get_boolean(PREF_INTYPE_CONSOLE))
+        cons_show("Show typing in console (/intype console)         : ON");
+    else
+        cons_show("Show typing in console (/intype console)         : OFF");
 }
 
 void
diff --git a/src/ui/core.c b/src/ui/core.c
index 931417c4..4e4e39a0 100644
--- a/src/ui/core.c
+++ b/src/ui/core.c
@@ -276,17 +276,21 @@ ui_contact_typing(const char* const barejid, const char* const resource)
     ProfWin* window = (ProfWin*)chatwin;
     ChatSession* session = chat_session_get(barejid);
 
-    if (prefs_get_boolean(PREF_INTYPE)) {
-        // no chat window for user
-        if (chatwin == NULL) {
+    // no chat window for user
+    if (chatwin == NULL) {
+        if (prefs_get_boolean(PREF_INTYPE_CONSOLE)) {
             cons_show_typing(barejid);
+        }
 
-            // have chat window but not currently in it
-        } else if (!wins_is_current(window)) {
+        // have chat window but not currently in it
+    } else if (!wins_is_current(window)) {
+        if (prefs_get_boolean(PREF_INTYPE_CONSOLE)) {
             cons_show_typing(barejid);
+        }
 
-            // in chat window with user, no session or session with resource
-        } else if (!session || (session && g_strcmp0(session->resource, resource) == 0)) {
+        // in chat window with user, no session or session with resource
+    } else if (!session || (session && g_strcmp0(session->resource, resource) == 0)) {
+        if (prefs_get_boolean(PREF_INTYPE)) {
             title_bar_set_typing(TRUE);
 
             int num = wins_get_num(window);