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

@@ -711,6 +711,18 @@ wins_new_plugin(const char* const plugin_name, const char* const tag)
return newwin;
}
ProfWin*
wins_new_vcard(vCard* vcard)
{
GList* keys = g_hash_table_get_keys(windows);
int result = _wins_get_next_available_num(keys);
g_list_free(keys);
ProfWin* newwin = win_create_vcard(vcard);
g_hash_table_insert(windows, GINT_TO_POINTER(result), newwin);
return newwin;
}
gboolean
wins_do_notify_remind(void)
{
@@ -805,6 +817,27 @@ wins_get_xmlconsole(void)
return NULL;
}
ProfVcardWin*
wins_get_vcard(void)
{
GList* values = g_hash_table_get_values(windows);
GList* curr = values;
while (curr) {
ProfWin* window = curr->data;
if (window->type == WIN_VCARD) {
ProfVcardWin* vcardwin = (ProfVcardWin*)window;
assert(vcardwin->memcheck == PROFVCARDWIN_MEMCHECK);
g_list_free(values);
return vcardwin;
}
curr = g_list_next(curr);
}
g_list_free(values);
return NULL;
}
GSList*
wins_get_chat_recipients(void)
{