about summary refs log tree commit diff stats
path: root/src/config
diff options
context:
space:
mode:
authorMichael Vetter <jubalh@iodoru.org>2020-03-10 07:12:13 +0100
committerMichael Vetter <jubalh@iodoru.org>2020-03-10 07:12:13 +0100
commit52e7e596aa0e7ca8b8db11c7c47c584fc7a75be6 (patch)
treed7020dffd72bd991f4ee73158db8fec763587ca6 /src/config
parent7e62d458ee22e9171bf5741cda5c8ce85b20bd6a (diff)
downloadprofani-tty-52e7e596aa0e7ca8b8db11c7c47c584fc7a75be6.tar.gz
xep-0084/avatar: add option to open avatar directly
Change:
`/avatar me@somewhere.org` -> `/avatar get me@somewhere.org`

New:
`/avatar cmd feh`
`/avatar open me@somewhere.org`

Implement https://github.com/profanity-im/profanity/issues/1281
Diffstat (limited to 'src/config')
-rw-r--r--src/config/preferences.c5
-rw-r--r--src/config/preferences.h1
2 files changed, 6 insertions, 0 deletions
diff --git a/src/config/preferences.c b/src/config/preferences.c
index 589a6c92..6b9b5f23 100644
--- a/src/config/preferences.c
+++ b/src/config/preferences.c
@@ -1770,6 +1770,7 @@ _get_group(preference_t pref)
         case PREF_GRLOG:
         case PREF_LOG_ROTATE:
         case PREF_LOG_SHARED:
+        case PREF_AVATAR_CMD:
             return PREF_GROUP_LOGGING;
         case PREF_AUTOAWAY_CHECK:
         case PREF_AUTOAWAY_MODE:
@@ -2048,6 +2049,8 @@ _get_key(preference_t pref)
             return "correction.allow";
         case PREF_HISTORY_COLOR_MUC:
             return "history.muc.color";
+        case PREF_AVATAR_CMD:
+            return "avatar.cmd";
         default:
             return NULL;
     }
@@ -2179,6 +2182,8 @@ _get_default_string(preference_t pref)
             return "false";
         case PREF_HISTORY_COLOR_MUC:
             return "unanimous";
+        case PREF_AVATAR_CMD:
+            return "xdg-open";
         default:
             return NULL;
     }
diff --git a/src/config/preferences.h b/src/config/preferences.h
index a9993e5b..37040214 100644
--- a/src/config/preferences.h
+++ b/src/config/preferences.h
@@ -166,6 +166,7 @@ typedef enum {
     PREF_OCCUPANTS_WRAP,
     PREF_CORRECTION_ALLOW,
     PREF_HISTORY_COLOR_MUC,
+    PREF_AVATAR_CMD,
 } preference_t;
 
 typedef struct prof_alias_t {