]> www.infradead.org Git - pidgin-chime.git/commitdiff
Add get_cb_alias
authorDavid Woodhouse <dwmw@amazon.co.uk>
Thu, 22 Mar 2018 23:43:28 +0000 (23:43 +0000)
committerDavid Woodhouse <dwmw@amazon.co.uk>
Fri, 23 Mar 2018 00:08:44 +0000 (00:08 +0000)
chat.c
chime.c
chime.h

diff --git a/chat.c b/chat.c
index 888b29c08dce43d9e26b9752513e2f6fd97e59de..59418300cb306bffbc76a0dc2dc83a02e2ba364a 100644 (file)
--- a/chat.c
+++ b/chat.c
@@ -825,3 +825,13 @@ GList *chime_purple_chat_menu(PurpleChat *pchat)
 
        return items;
 }
+
+char *chime_purple_get_cb_alias(PurpleConnection *conn, int id, const gchar *who)
+{
+       ChimeContact *contact = chime_connection_contact_by_email(PURPLE_CHIME_CXN(conn), who);
+
+       if (contact)
+               return g_strdup(chime_contact_get_display_name(contact));
+       else
+               return NULL;
+}
diff --git a/chime.c b/chime.c
index cdc13a6ad786f294e46505ad6be3e16dc2d47e73..fff0f3bf924c6a29cb152bc484b7214e8a262976 100644 (file)
--- a/chime.c
+++ b/chime.c
@@ -320,7 +320,12 @@ static GList *chime_purple_blist_node_menu(PurpleBlistNode *node)
        }
 }
 
+#ifdef PURPLE_BLIST_NODE_IS_VISIBLE /* This was added at the same time */
+#define PRPL_HAS_GET_CB_ALIAS
+#endif
+
 static PurplePluginProtocolInfo chime_prpl_info = {
+       .struct_size = sizeof(PurplePluginProtocolInfo),
        .options = OPT_PROTO_NO_PASSWORD,
        .list_icon = chime_purple_list_icon,
        .login = chime_purple_login,
@@ -343,6 +348,9 @@ static PurplePluginProtocolInfo chime_prpl_info = {
        .send_typing = chime_send_typing,
        .set_idle = chime_purple_set_idle,
        .blist_node_menu = chime_purple_blist_node_menu,
+#ifdef PRPL_HAS_GET_CB_ALIAS
+       .get_cb_alias = chime_purple_get_cb_alias,
+#endif
 };
 
 static void chime_purple_show_about_plugin(PurplePluginAction *action)
diff --git a/chime.h b/chime.h
index aa2974558fd3de394bc99e7887496b753905b289..e6a4bcc2e7d5da7031bdd646e3274060bf015068 100644 (file)
--- a/chime.h
+++ b/chime.h
@@ -97,6 +97,7 @@ void on_chime_new_group_conv(ChimeConnection *cxn, ChimeConversation *conv, Purp
 void chime_purple_chat_invite(PurpleConnection *conn, int id, const char *message, const char *who);
 struct chime_chat *do_join_chat(PurpleConnection *conn, ChimeConnection *cxn, ChimeObject *obj, JsonNode *first_msg, ChimeMeeting *meeting);
 GList *chime_purple_chat_menu(PurpleChat *chat);
+char *chime_purple_get_cb_alias(PurpleConnection *conn, int id, const gchar *who);
 
 /* conversations.c */
 void on_chime_new_conversation(ChimeConnection *cxn, ChimeConversation *conv, PurpleConnection *conn);