about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--.github/FUNDING.yml12
-rw-r--r--CHANGELOG10
-rw-r--r--src/command/cmd_funcs.c14
-rw-r--r--src/config/theme.c8
-rw-r--r--src/ui/statusbar.c66
-rw-r--r--src/xmpp/roster_list.c8
-rw-r--r--src/xmpp/roster_list.h1
-rw-r--r--theme_template2
-rw-r--r--themes/aqua1
-rw-r--r--themes/batman1
-rw-r--r--themes/bios2
-rw-r--r--themes/boothj52
-rw-r--r--themes/boothj5_laptop2
-rw-r--r--themes/boothj5_slack2
-rw-r--r--themes/forest1
-rw-r--r--themes/hacker1
-rw-r--r--themes/headache1
-rw-r--r--themes/joker1
-rw-r--r--themes/mono1
-rw-r--r--themes/orange1
-rw-r--r--themes/original1
-rw-r--r--themes/original_bright1
-rw-r--r--themes/shade1
23 files changed, 104 insertions, 36 deletions
diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml
new file mode 100644
index 00000000..416b4ddb
--- /dev/null
+++ b/.github/FUNDING.yml
@@ -0,0 +1,12 @@
+# These are supported funding model platforms
+
+github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
+patreon: jubalh
+open_collective: # Replace with a single Open Collective username
+ko_fi: # Replace with a single Ko-fi username
+tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
+community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
+liberapay: # Replace with a single Liberapay username
+issuehunt: # Replace with a single IssueHunt username
+otechie: # Replace with a single Otechie username
+custom: # Replace with a single custom sponsorship URL
diff --git a/CHANGELOG b/CHANGELOG
index 03bfb299..10b54305 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,4 +1,4 @@
-0.6.0
+0.6.0 (2019-02-18)
 =====
 
 - Allow moving vertical window positions (/titlebar, /mainwin, /statusbar, /inputwin)
@@ -21,7 +21,7 @@
 - Add possibility to close windows via prof_win_close inputrc hook
 - Bug fixes: https://github.com/profanity-im/profanity/milestone/16?closed=1
 
-0.5.1
+0.5.1 (2017-01-28)
 =====
 
 - Add prof.get_room_nick plugins api function
@@ -35,7 +35,7 @@
 - Fix CVE-2017-5592 (incorrect implementation of Message Carbons allowing social engineering attacks)
 - Bug fixes: https://github.com/profanity-im/profanity/milestone/15?closed=1
 
-0.5.0
+0.5.0 (2016-09-15)
 =====
 
 - Plugins API supporting C and Python plugins
@@ -64,7 +64,7 @@
 - Custom readline functions for navigation key bindings
 - Autocomplete command arguments when no characters entered
 
-0.4.7
+0.4.7 (2015-09-20)
 =====
 
 - GNU Readline
@@ -80,7 +80,7 @@
 - Reformatted help
 - devel: Added functional tests using libexpect and libstabber
 
-0.4.6
+0.4.6 (2015-03-03)
 =====
 
 - 16 colour support (/theme colours)
diff --git a/src/command/cmd_funcs.c b/src/command/cmd_funcs.c
index 999afd10..f2c9aa1d 100644
--- a/src/command/cmd_funcs.c
+++ b/src/command/cmd_funcs.c
@@ -6555,12 +6555,20 @@ cmd_autoconnect(ProfWin *window, const char *const command, gchar **args)
         prefs_set_string(PREF_CONNECT_ACCOUNT, NULL);
         cons_show("Autoconnect account disabled.");
     } else if (strcmp(args[0], "set") == 0) {
-        prefs_set_string(PREF_CONNECT_ACCOUNT, args[1]);
-        cons_show("Autoconnect account set to: %s.", args[1]);
+        if (args[1] == NULL || strlen(args[1]) == 0) {
+            cons_bad_cmd_usage(command);
+        } else {
+            if (accounts_account_exists(args[1])) {
+                prefs_set_string(PREF_CONNECT_ACCOUNT, args[1]);
+                cons_show("Autoconnect account set to: %s.", args[1]);
+            } else {
+                cons_show_error("Account '%s' does not exist.", args[1]);
+            }
+        }
     } else {
         cons_bad_cmd_usage(command);
     }
-    return true;
+    return TRUE;
 }
 
 gboolean
diff --git a/src/config/theme.c b/src/config/theme.c
index a0ca8356..53f55401 100644
--- a/src/config/theme.c
+++ b/src/config/theme.c
@@ -574,6 +574,14 @@ _load_preferences(void)
         }
     }
 
+    if (g_key_file_has_key(theme, "ui", "omemo.char", NULL)) {
+        gchar *ch = g_key_file_get_string(theme, "ui", "omemo.char", NULL);
+        if (ch && strlen(ch) > 0) {
+            prefs_set_omemo_char(ch[0]);
+            g_free(ch);
+        }
+    }
+
     if (g_key_file_has_key(theme, "ui", "titlebar.position", NULL) &&
             g_key_file_has_key(theme, "ui", "mainwin.position", NULL) &&
             g_key_file_has_key(theme, "ui", "statusbar.position", NULL) &&
diff --git a/src/ui/statusbar.c b/src/ui/statusbar.c
index d0ce7309..0e24ab3f 100644
--- a/src/ui/statusbar.c
+++ b/src/ui/statusbar.c
@@ -57,6 +57,7 @@ typedef struct _status_bar_tab_t {
     win_type_t window_type;
     char *identifier;
     gboolean highlight;
+    char *display_name;
 } StatusBarTab;
 
 typedef struct _status_bar_t {
@@ -94,6 +95,7 @@ status_bar_init(void)
     StatusBarTab *console = malloc(sizeof(StatusBarTab));
     console->window_type = WIN_CONSOLE;
     console->identifier = strdup("console");
+    console->display_name = NULL;
     g_hash_table_insert(statusbar->tabs, GINT_TO_POINTER(1), console);
     statusbar->current_tab = 1;
 
@@ -171,7 +173,7 @@ status_bar_inactive(const int win)
 }
 
 void
-status_bar_active(const int win, win_type_t wintype, char *identifier)
+_create_tab(const int win, win_type_t wintype, char *identifier, gboolean highlight)
 {
     int true_win = win;
     if (true_win == 0) {
@@ -180,28 +182,44 @@ status_bar_active(const int win, win_type_t wintype, char *identifier)
 
     StatusBarTab *tab = malloc(sizeof(StatusBarTab));
     tab->identifier = strdup(identifier);
-    tab->highlight = FALSE;
+    tab->highlight = highlight;
     tab->window_type = wintype;
+    tab->display_name = NULL;
+
+    if (tab->window_type == WIN_CHAT) {
+        PContact contact = NULL;
+        if (roster_exists()) {
+            contact = roster_get_contact(tab->identifier);
+        }
+        if (contact && p_contact_name(contact)) {
+            tab->display_name = strdup(p_contact_name(contact));
+        } else {
+            char *pref = prefs_get_string(PREF_STATUSBAR_CHAT);
+            if (g_strcmp0("user", pref) == 0) {
+                Jid *jidp = jid_create(tab->identifier);
+                tab->display_name = strdup(jidp->localpart);
+                jid_destroy(jidp);
+            } else {
+                tab->display_name = strdup(tab->identifier);
+            }
+        }
+    }
+
     g_hash_table_replace(statusbar->tabs, GINT_TO_POINTER(true_win), tab);
 
     status_bar_draw();
 }
 
 void
-status_bar_new(const int win, win_type_t wintype, char* identifier)
+status_bar_active(const int win, win_type_t wintype, char *identifier)
 {
-    int true_win = win;
-    if (true_win == 0) {
-        true_win = 10;
-    }
-
-    StatusBarTab *tab = malloc(sizeof(StatusBarTab));
-    tab->identifier = strdup(identifier);
-    tab->highlight = TRUE;
-    tab->window_type = wintype;
-    g_hash_table_replace(statusbar->tabs, GINT_TO_POINTER(true_win), tab);
+    _create_tab(win, wintype, identifier, FALSE);
+}
 
-    status_bar_draw();
+void
+status_bar_new(const int win, win_type_t wintype, char* identifier)
+{
+    _create_tab(win, wintype, identifier, TRUE);
 }
 
 void
@@ -461,8 +479,12 @@ _destroy_tab(StatusBarTab *tab)
         if (tab->identifier) {
             free(tab->identifier);
         }
+        if (tab->display_name) {
+            free(tab->display_name);
+        }
         free(tab);
     }
+    tab = NULL;
 }
 
 static int
@@ -520,19 +542,8 @@ _display_name(StatusBarTab *tab)
     } else if (tab->window_type == WIN_PLUGIN) {
         fullname = strdup(tab->identifier);
     } else if (tab->window_type == WIN_CHAT) {
-        PContact contact = roster_get_contact(tab->identifier);
-        if (contact && p_contact_name(contact)) {
-            fullname = strdup(p_contact_name(contact));
-        } else {
-            char *pref = prefs_get_string(PREF_STATUSBAR_CHAT);
-            if (g_strcmp0("user", pref) == 0) {
-                Jid *jidp = jid_create(tab->identifier);
-                char *user = strdup(jidp->localpart);
-                jid_destroy(jidp);
-                fullname = user;
-            } else {
-                fullname = strdup(tab->identifier);
-            }
+        if (tab && tab->display_name) {
+            fullname = strdup(tab->display_name);
         }
     } else if (tab->window_type == WIN_MUC) {
         char *pref = prefs_get_string(PREF_STATUSBAR_ROOM);
@@ -593,5 +604,4 @@ _display_name(StatusBarTab *tab)
     g_free(trimmed);
 
     return trimmedname;
-
 }
diff --git a/src/xmpp/roster_list.c b/src/xmpp/roster_list.c
index 81a51581..7954e3de 100644
--- a/src/xmpp/roster_list.c
+++ b/src/xmpp/roster_list.c
@@ -707,3 +707,11 @@ roster_process_pending_presence(void)
     g_slist_free(roster_pending_presence);
     roster_pending_presence = NULL;
 }
+
+gboolean
+roster_exists(void) {
+    if (roster != NULL) {
+        return TRUE;
+    }
+    return FALSE;
+}
diff --git a/src/xmpp/roster_list.h b/src/xmpp/roster_list.h
index 57a932be..93f1253e 100644
--- a/src/xmpp/roster_list.h
+++ b/src/xmpp/roster_list.h
@@ -73,5 +73,6 @@ char* roster_get_msg_display_name(const char *const barejid, const char *const r
 gint roster_compare_name(PContact a, PContact b);
 gint roster_compare_presence(PContact a, PContact b);
 void roster_process_pending_presence(void);
+gboolean roster_exists(void);
 
 #endif
diff --git a/theme_template b/theme_template
index feab8bfc..d59425de 100644
--- a/theme_template
+++ b/theme_template
@@ -15,6 +15,7 @@ titlebar.dnd=
 titlebar.xa=
 statusbar=
 statusbar.text=
+statusbar.time=
 statusbar.brackets=
 statusbar.active=
 statusbar.new=
@@ -139,6 +140,7 @@ occupants.header.char=
 wins.autotidy=
 otr.char=
 pgp.char=
+omemo.char=
 console.muc=
 console.chat=
 console.private=
diff --git a/themes/aqua b/themes/aqua
index 8c86da3a..48b3d4e7 100644
--- a/themes/aqua
+++ b/themes/aqua
@@ -15,6 +15,7 @@ titlebar.dnd=cyan
 titlebar.xa=bold_cyan
 statusbar=blue
 statusbar.text=bold_white
+statusbar.time=bold_white
 statusbar.brackets=white
 statusbar.active=cyan
 statusbar.new=white
diff --git a/themes/batman b/themes/batman
index f9186525..fa7e7f18 100644
--- a/themes/batman
+++ b/themes/batman
@@ -5,6 +5,7 @@ statusbar=yellow
 titlebar.text=black
 titlebar.brackets=black
 statusbar.text=magenta
+statusbar.time=magenta
 statusbar.brackets=black
 statusbar.active=magenta
 statusbar.new=magenta
diff --git a/themes/bios b/themes/bios
index aded8473..570641bd 100644
--- a/themes/bios
+++ b/themes/bios
@@ -15,6 +15,7 @@ titlebar.dnd=black
 titlebar.chat=black
 statusbar=white
 statusbar.text=black
+statusbar.time=black
 statusbar.brackets=black
 statusbar.active=black
 statusbar.new=black
@@ -129,6 +130,7 @@ occupants.jid=false
 wins.autotidy=true
 otr.char=@
 pgp.char=%
+omemo.char=*
 tls.show=true
 console.muc=first
 titlebar.position=1
diff --git a/themes/boothj5 b/themes/boothj5
index bbac89a6..ae8ff914 100644
--- a/themes/boothj5
+++ b/themes/boothj5
@@ -15,6 +15,7 @@ titlebar.dnd=bold_red
 titlebar.chat=bold_green
 statusbar=blue
 statusbar.text=bold_white
+statusbar.time=bold_white
 statusbar.brackets=bold_white
 statusbar.active=bold_cyan
 statusbar.new=bold_white
@@ -134,6 +135,7 @@ occupants.jid=false
 wins.autotidy=true
 otr.char=@
 pgp.char=%
+omemo.char=*
 tls.show=true
 console.muc=first
 console.chat=all
diff --git a/themes/boothj5_laptop b/themes/boothj5_laptop
index 4ca185fc..af3958bd 100644
--- a/themes/boothj5_laptop
+++ b/themes/boothj5_laptop
@@ -15,6 +15,7 @@ titlebar.dnd=bold_red
 titlebar.chat=bold_green
 statusbar=blue
 statusbar.text=bold_white
+statusbar.time=bold_white
 statusbar.brackets=bold_white
 statusbar.active=bold_cyan
 statusbar.new=bold_white
@@ -134,6 +135,7 @@ occupants.jid=false
 wins.autotidy=true
 otr.char=@
 pgp.char=%
+omemo.char=*
 tls.show=true
 console.muc=first
 console.chat=all
diff --git a/themes/boothj5_slack b/themes/boothj5_slack
index b8efb132..d1546d05 100644
--- a/themes/boothj5_slack
+++ b/themes/boothj5_slack
@@ -15,6 +15,7 @@ titlebar.dnd=bold_red
 titlebar.chat=bold_green
 statusbar=blue
 statusbar.text=bold_white
+statusbar.time=bold_white
 statusbar.brackets=bold_white
 statusbar.active=bold_cyan
 statusbar.new=bold_white
@@ -130,6 +131,7 @@ occupants.jid=false
 wins.autotidy=true
 otr.char=@
 pgp.char=%
+omemo.char=*
 tls.show=true
 console.muc=first
 console.chat=all
diff --git a/themes/forest b/themes/forest
index d216a2f1..5675e496 100644
--- a/themes/forest
+++ b/themes/forest
@@ -15,6 +15,7 @@ titlebar.dnd=white
 titlebar.xa=white
 statusbar=green
 statusbar.text=black
+statusbar.time=black
 statusbar.brackets=black
 statusbar.active=bold_green
 statusbar.new=white
diff --git a/themes/hacker b/themes/hacker
index 95785bf9..8639dbe6 100644
--- a/themes/hacker
+++ b/themes/hacker
@@ -15,6 +15,7 @@ titlebar.dnd=black
 titlebar.xa=black
 statusbar=green
 statusbar.text=black
+statusbar.time=black
 statusbar.brackets=black
 statusbar.active=black
 statusbar.new=black
diff --git a/themes/headache b/themes/headache
index fd8ccca5..5b2f5cba 100644
--- a/themes/headache
+++ b/themes/headache
@@ -15,6 +15,7 @@ titlebar.dnd=black
 titlebar.xa=white
 statusbar=default
 statusbar.text=white
+statusbar.time=white
 statusbar.brackets=red
 statusbar.active=cyan
 statusbar.new=white
diff --git a/themes/joker b/themes/joker
index db5e6d54..39324896 100644
--- a/themes/joker
+++ b/themes/joker
@@ -15,6 +15,7 @@ titlebar.dnd=black
 titlebar.xa=white
 statusbar=magenta
 statusbar.text=green
+statusbar.time=green
 statusbar.brackets=cyan
 statusbar.active=green
 statusbar.new=white
diff --git a/themes/mono b/themes/mono
index fcb16230..e40a3278 100644
--- a/themes/mono
+++ b/themes/mono
@@ -15,6 +15,7 @@ titlebar.dnd=black
 titlebar.xa=black
 statusbar=white
 statusbar.text=black
+statusbar.time=black
 statusbar.brackets=black
 statusbar.active=black
 statusbar.new=black
diff --git a/themes/orange b/themes/orange
index 353dc4d3..b3a92ead 100644
--- a/themes/orange
+++ b/themes/orange
@@ -15,6 +15,7 @@ titlebar.dnd=black
 titlebar.xa=white
 statusbar=green
 statusbar.text=black
+statusbar.time=black
 statusbar.brackets=blue
 statusbar.active=white
 statusbar.new=white
diff --git a/themes/original b/themes/original
index 38eba694..ef325bd0 100644
--- a/themes/original
+++ b/themes/original
@@ -15,6 +15,7 @@ titlebar.dnd=white
 titlebar.xa=white
 statusbar=blue
 statusbar.text=white
+statusbar.time=white
 statusbar.brackets=cyan
 statusbar.active=cyan
 statusbar.new=white
diff --git a/themes/original_bright b/themes/original_bright
index fea535ca..8f073610 100644
--- a/themes/original_bright
+++ b/themes/original_bright
@@ -15,6 +15,7 @@ titlebar.dnd=bold_white
 titlebar.xa=bold_white
 statusbar=blue
 statusbar.text=bold_white
+statusbar.time=bold_white
 statusbar.brackets=bold_cyan
 statusbar.active=bold_cyan
 statusbar.new=bold_white
diff --git a/themes/shade b/themes/shade
index 7672ea32..980b7e7f 100644
--- a/themes/shade
+++ b/themes/shade
@@ -15,6 +15,7 @@ titlebar.dnd=red
 titlebar.xa=green
 statusbar=default
 statusbar.text=magenta
+statusbar.time=magenta
 statusbar.brackets=magenta
 statusbar.active=white
 statusbar.new=green