Add vCard support

Only nicknames, photos, birthdays, addresses, telephone numbers, emails,
JIDs, titles, roles, notes, and URLs are supported

Due to the synopsis array not having enough space, `/vcard photo
open-self` and `/vcard photo save-self` are not documented properly in
the synopsis section of the `/vcard` command, but they are documented in
the arguments section

Fixed memory leak in vcard autocomplete (thanks to debXwoody)
This commit is contained in:
Marouane L
2022-09-06 17:29:07 +01:00
parent fc8455ba34
commit f934c5b59f
25 changed files with 3688 additions and 7 deletions

View File

@@ -60,6 +60,7 @@
#define DIR_DOWNLOADS "downloads"
#define DIR_EDITOR "editor"
#define DIR_CERTS "certs"
#define DIR_PHOTOS "photos"
void files_create_directories(void);

View File

@@ -1770,6 +1770,7 @@ _get_group(preference_t pref)
case PREF_TIME_XMLCONSOLE:
case PREF_TIME_STATUSBAR:
case PREF_TIME_LASTACTIVITY:
case PREF_TIME_VCARD:
case PREF_ROSTER:
case PREF_ROSTER_OFFLINE:
case PREF_ROSTER_RESOURCE:
@@ -1850,6 +1851,7 @@ _get_group(preference_t pref)
case PREF_AVATAR_CMD:
case PREF_URL_OPEN_CMD:
case PREF_URL_SAVE_CMD:
case PREF_VCARD_PHOTO_CMD:
return PREF_GROUP_EXECUTABLES;
case PREF_AUTOAWAY_CHECK:
case PREF_AUTOAWAY_MODE:
@@ -2029,6 +2031,8 @@ _get_key(preference_t pref)
return "time.statusbar";
case PREF_TIME_LASTACTIVITY:
return "time.lastactivity";
case PREF_TIME_VCARD:
return "time.vcard";
case PREF_ROSTER:
return "roster";
case PREF_ROSTER_OFFLINE:
@@ -2159,6 +2163,8 @@ _get_key(preference_t pref)
return "log";
case PREF_MOOD:
return "mood";
case PREF_VCARD_PHOTO_CMD:
return "vcard.photo.cmd";
default:
return NULL;
}
@@ -2269,6 +2275,8 @@ _get_default_string(preference_t pref)
return "%H:%M";
case PREF_TIME_LASTACTIVITY:
return "%d/%m/%y %H:%M:%S";
case PREF_TIME_VCARD:
return "%d/%m/%y";
case PREF_PGP_LOG:
return "on";
case PREF_CONSOLE_MUC:
@@ -2293,6 +2301,8 @@ _get_default_string(preference_t pref)
return "xdg-open";
case PREF_URL_OPEN_CMD:
return "xdg-open %u";
case PREF_VCARD_PHOTO_CMD:
return "xdg-open %p";
case PREF_COMPOSE_EDITOR:
{
gchar* editor = getenv("EDITOR");

View File

@@ -105,6 +105,7 @@ typedef enum {
PREF_TIME_XMLCONSOLE,
PREF_TIME_STATUSBAR,
PREF_TIME_LASTACTIVITY,
PREF_TIME_VCARD,
PREF_STATUSES,
PREF_STATUSES_CONSOLE,
PREF_STATUSES_CHAT,
@@ -181,6 +182,7 @@ typedef enum {
PREF_NOTIFY_ROOM_OFFLINE,
PREF_OX_LOG,
PREF_MOOD,
PREF_VCARD_PHOTO_CMD,
} preference_t;
typedef struct prof_alias_t