about summary refs log tree commit diff stats
path: root/src/ui
diff options
context:
space:
mode:
authorMichael Vetter <jubalh@iodoru.org>2020-04-25 17:13:22 +0200
committerMichael Vetter <jubalh@iodoru.org>2020-04-25 17:19:02 +0200
commit85520ecdc5d2e6ac6654817572b8fd99e43e25d9 (patch)
tree6837c17e9a762cf0f11d06ffd9b15a9ce6a34b48 /src/ui
parent570863df1b84f022f21f868dbdc4d2b42aebe914 (diff)
downloadprofani-tty-85520ecdc5d2e6ac6654817572b8fd99e43e25d9.tar.gz
Remove unanimous MAM display
For some time users could choose to have the old way "unanimous" where
all the MUC history is just grey (or whatever was set). Now it is always
just displayed like regular new incoming MUC text.
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/console.c4
-rw-r--r--src/ui/mucwin.c23
-rw-r--r--src/ui/window.c26
3 files changed, 14 insertions, 39 deletions
diff --git a/src/ui/console.c b/src/ui/console.c
index 67f859b3..829870d9 100644
--- a/src/ui/console.c
+++ b/src/ui/console.c
@@ -1871,10 +1871,6 @@ cons_logging_setting(void)
         cons_show("Groupchat logging (/logging group)          : ON");
     else
         cons_show("Groupchat logging (/logging group)          : OFF");
-
-    char *pref = prefs_get_string(PREF_HISTORY_COLOR_MUC);
-    cons_show("MUC history color (/logging group color)    : %s", pref);
-    prefs_free_string(pref);
 }
 
 void
diff --git a/src/ui/mucwin.c b/src/ui/mucwin.c
index cc921b21..ae98eb43 100644
--- a/src/ui/mucwin.c
+++ b/src/ui/mucwin.c
@@ -365,27 +365,16 @@ mucwin_history(ProfMucWin *mucwin, const ProfMessage *const message)
 {
     assert(mucwin != NULL);
 
-    ProfWin *window = (ProfWin*)mucwin;
     char *nick = message->from_jid->resourcepart;
+    char *mynick = muc_nick(mucwin->roomjid);
+    GSList *mentions = get_mentions(prefs_get_boolean(PREF_NOTIFY_MENTION_WHOLE_WORD), prefs_get_boolean(PREF_NOTIFY_MENTION_CASE_SENSITIVE), message->plain, mynick);
+    GList *triggers = prefs_message_get_triggers(message->plain);
 
-    // 'unanimous' all in one color (like always was)
-    // 'regular' colored like new messages too
-    char *muc_history_color = prefs_get_string(PREF_HISTORY_COLOR_MUC);
-
-    if (g_strcmp0(muc_history_color, "unanimous") == 0) {
-        win_print_history(window, message);
-    } else {
-        char *mynick = muc_nick(mucwin->roomjid);
-        GSList *mentions = get_mentions(prefs_get_boolean(PREF_NOTIFY_MENTION_WHOLE_WORD), prefs_get_boolean(PREF_NOTIFY_MENTION_CASE_SENSITIVE), message->plain, mynick);
-        GList *triggers = prefs_message_get_triggers(message->plain);
-
-        mucwin_incoming_msg(mucwin, message, mentions, triggers, FALSE);
+    mucwin_incoming_msg(mucwin, message, mentions, triggers, FALSE);
 
-        g_slist_free(mentions);
-        g_list_free_full(triggers, free);
-    }
+    g_slist_free(mentions);
+    g_list_free_full(triggers, free);
 
-    g_free(muc_history_color);
     plugins_on_room_history_message(mucwin->roomjid, nick, message->plain, message->timestamp);
 }
 
diff --git a/src/ui/window.c b/src/ui/window.c
index 2ebf7a31..763f389d 100644
--- a/src/ui/window.c
+++ b/src/ui/window.c
@@ -1223,29 +1223,19 @@ win_print_history(ProfWin *window, const ProfMessage *const message)
 {
     g_date_time_ref(message->timestamp);
 
-    int flags = 0;
-
     char *display_name;
-    if (message->type == PROF_MSG_TYPE_MUC) {
-        display_name = strdup(message->from_jid->resourcepart);
+    int flags = 0;
+    const char *jid = connection_get_fulljid();
+    Jid *jidp = jid_create(jid);
 
-        char *muc_history_color = prefs_get_string(PREF_HISTORY_COLOR_MUC);
-        if (g_strcmp0(muc_history_color, "unanimous") == 0) {
-            flags = NO_COLOUR_FROM;
-        }
-        g_free(muc_history_color);
+    if (g_strcmp0(jidp->barejid, message->from_jid->barejid) == 0) {
+        display_name = strdup("me");
     } else {
-        const char *jid = connection_get_fulljid();
-        Jid *jidp = jid_create(jid);
-
-        if (g_strcmp0(jidp->barejid, message->from_jid->barejid) == 0) {
-            display_name = strdup("me");
-        } else {
-            display_name = roster_get_msg_display_name(message->from_jid->barejid, message->from_jid->resourcepart);
-        }
-        jid_destroy(jidp);
+        display_name = roster_get_msg_display_name(message->from_jid->barejid, message->from_jid->resourcepart);
     }
 
+    jid_destroy(jidp);
+
     buffer_append(window->layout->buffer, "-", 0, message->timestamp, flags, THEME_TEXT_HISTORY, display_name, NULL, message->plain, NULL, NULL);
     _win_print_internal(window, "-", 0, message->timestamp, flags, THEME_TEXT_HISTORY, display_name, message->plain, NULL);