comparison mcabber/src/jabglue.c @ 318:45076d02eeef

The /status command can specify a status message We can now use: "/status dnd On the phone..." Related change: Display the buddy status message when a buddy connects/changes his/her status.
author Mikael Berthe <mikael@lilotux.net>
date Fri, 15 Jul 2005 18:45:41 +0100
parents 1d6b16d9c577
children db45371106a5
comparison
equal deleted inserted replaced
317:f2d29644a0df 318:45076d02eeef
309 // We'll need to update the roster if we switch to/from offline because 309 // We'll need to update the roster if we switch to/from offline because
310 // we don't know the presences of buddies when offline... 310 // we don't know the presences of buddies when offline...
311 if (mystatus == offline || st == offline) 311 if (mystatus == offline || st == offline)
312 update_roster = TRUE; 312 update_roster = TRUE;
313 313
314 hk_mystatuschange(0, mystatus, st); 314 hk_mystatuschange(0, mystatus, st, msg);
315 mystatus = st; 315 mystatus = st;
316 } 316 }
317 317
318 void jb_send_msg(const char *jid, const char *text) 318 void jb_send_msg(const char *jid, const char *text)
319 { 319 {
609 } 609 }
610 610
611 void packethandler(jconn conn, jpacket packet) 611 void packethandler(jconn conn, jpacket packet)
612 { 612 {
613 char *p, *r; 613 char *p, *r;
614 const char *m;
614 xmlnode x, y; 615 xmlnode x, y;
615 char *from=NULL, *type=NULL, *body=NULL, *enc=NULL; 616 char *from=NULL, *type=NULL, *body=NULL, *enc=NULL;
616 char *ns=NULL; 617 char *ns=NULL;
617 char *id=NULL; 618 char *id=NULL;
618 enum imstatus ust; 619 enum imstatus ust;
859 p = xmlnode_get_data(x); 860 p = xmlnode_get_data(x);
860 else 861 else
861 p = NULL; 862 p = NULL;
862 863
863 r = jidtodisp(from); 864 r = jidtodisp(from);
864 if (ust != roster_getstatus(r)) 865 m = roster_getstatusmsg(r);
866 // Call hk_statuschange() if status has changed or if the
867 // status message is different
868 if ((ust != roster_getstatus(r)) || (p && (!m || strcmp(p, m))))
865 hk_statuschange(r, 0, ust, p); 869 hk_statuschange(r, 0, ust, p);
866 g_free(r); 870 g_free(r);
867 break; 871 break;
868 872
869 case JPACKET_S10N: 873 case JPACKET_S10N: