aboutsummaryrefslogtreecommitdiffstats
path: root/protocols/jabber/iq.c
diff options
context:
space:
mode:
authordequis <dx@dxzone.com.ar>2015-02-21 03:18:21 -0300
committerdequis <dx@dxzone.com.ar>2015-04-28 10:47:48 -0300
commit40cfbc54088702d4887ccfb761eafe65b4376d59 (patch)
tree58f9e7290c934eee6ea3506033923279643cd455 /protocols/jabber/iq.c
parent1493c4b7eff51e231c65f7728c0cf84ca45cf837 (diff)
hipchat: Basic implementation: Auth, profile and mention names
This is enough to log in with their usernames, make 'chat add' based groupchat joins slightly more smooth, and see mention names as nicks. All the MUC list stuff is left out intentionally since that's not as stable as I wish.
Diffstat (limited to 'protocols/jabber/iq.c')
-rw-r--r--protocols/jabber/iq.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/protocols/jabber/iq.c b/protocols/jabber/iq.c
index d7ba6f55..33889d32 100644
--- a/protocols/jabber/iq.c
+++ b/protocols/jabber/iq.c
@@ -26,7 +26,6 @@
static xt_status jabber_parse_roster(struct im_connection *ic, struct xt_node *node, struct xt_node *orig);
static xt_status jabber_iq_display_vcard(struct im_connection *ic, struct xt_node *node, struct xt_node *orig);
-static int jabber_iq_disco_server(struct im_connection *ic);
xt_status jabber_pkt_iq(struct xt_node *node, gpointer data)
{
@@ -373,6 +372,7 @@ int jabber_get_roster(struct im_connection *ic)
static xt_status jabber_parse_roster(struct im_connection *ic, struct xt_node *node, struct xt_node *orig)
{
+ struct jabber_data *jd = ic->proto_data;
struct xt_node *query, *c;
int initial = (orig != NULL);
@@ -387,6 +387,7 @@ static xt_status jabber_parse_roster(struct im_connection *ic, struct xt_node *n
char *jid = xt_find_attr(c, "jid");
char *name = xt_find_attr(c, "name");
char *sub = xt_find_attr(c, "subscription");
+ char *mention_name = xt_find_attr(c, "mention_name");
if (jid && sub) {
if ((strcmp(sub, "both") == 0 || strcmp(sub, "to") == 0)) {
@@ -396,6 +397,12 @@ static xt_status jabber_parse_roster(struct im_connection *ic, struct xt_node *n
if (name) {
imcb_rename_buddy(ic, jid, name);
}
+
+ /* This could also be used to set the full name as nick for fb/gtalk,
+ * but i'm keeping the old (ugly?) default behavior just to be safe */
+ if (mention_name && (jd->flags & JFLAG_HIPCHAT)) {
+ imcb_buddy_nick_hint(ic, jid, mention_name);
+ }
} else if (strcmp(sub, "remove") == 0) {
jabber_buddy_remove_bare(ic, jid);
imcb_remove_buddy(ic, jid, NULL);
@@ -854,7 +861,7 @@ static xt_status jabber_iq_version_response(struct im_connection *ic,
static xt_status jabber_iq_disco_server_response(struct im_connection *ic,
struct xt_node *node, struct xt_node *orig);
-static int jabber_iq_disco_server(struct im_connection *ic)
+int jabber_iq_disco_server(struct im_connection *ic)
{
struct xt_node *node, *iq;
struct jabber_data *jd = ic->proto_data;