comparison mcabber/src/hooks.c @ 438:b44be19d6229

Handle multiple resources for the same buddy
author Mikael Berthe <mikael@lilotux.net>
date Mon, 19 Sep 2005 23:32:42 +0200
parents f8f3c7493457
children 03bb57383cea
comparison
equal deleted inserted replaced
437:170f1aa12989 438:b44be19d6229
58 // External command 58 // External command
59 hk_ext_cmd(jid, 'M', 'R', NULL); 59 hk_ext_cmd(jid, 'M', 'R', NULL);
60 // We need to rebuild the list if the sender is unknown or 60 // We need to rebuild the list if the sender is unknown or
61 // if the sender is offline/invisible and hide_offline_buddies is set 61 // if the sender is offline/invisible and hide_offline_buddies is set
62 if (new_guy || 62 if (new_guy ||
63 (roster_getstatus(jid) == offline && buddylist_get_hide_offline_buddies())) 63 (roster_getstatus(jid, NULL) == offline &&
64 buddylist_get_hide_offline_buddies()))
64 { 65 {
65 buddylist_build(); 66 buddylist_build();
66 update_roster = TRUE; 67 update_roster = TRUE;
67 } 68 }
68 } 69 }
73 hlog_write_message(jid, timestamp, TRUE, msg); 74 hlog_write_message(jid, timestamp, TRUE, msg);
74 // External command 75 // External command
75 hk_ext_cmd(jid, 'M', 'S', NULL); 76 hk_ext_cmd(jid, 'M', 'S', NULL);
76 } 77 }
77 78
78 inline void hk_statuschange(const char *jid, time_t timestamp, 79 inline void hk_statuschange(const char *jid, const char *resname, gchar prio,
79 enum imstatus status, const char *status_msg) 80 time_t timestamp, enum imstatus status,
81 const char *status_msg)
80 { 82 {
81 scr_LogPrint(LPRINT_LOGNORM, "Buddy status has changed: [%c>%c] <%s> %s", 83 const char *rn = (resname ? resname : "default");
82 imstatus2char[roster_getstatus(jid)], imstatus2char[status], jid, 84 scr_LogPrint(LPRINT_LOGNORM, "Buddy status has changed: [%c>%c] <%s/%s> %s",
83 ((status_msg) ? status_msg : "")); 85 imstatus2char[roster_getstatus(jid, resname)],
84 roster_setstatus(jid, status, status_msg); 86 imstatus2char[status], jid, rn,
87 ((status_msg) ? status_msg : ""));
88 roster_setstatus(jid, rn, prio, status, status_msg);
85 buddylist_build(); 89 buddylist_build();
86 scr_DrawRoster(); 90 scr_DrawRoster();
87 hlog_write_status(jid, 0, status, status_msg); 91 hlog_write_status(jid, 0, status, status_msg);
88 // External command 92 // External command
89 hk_ext_cmd(jid, 'S', imstatus2char[status], NULL); 93 hk_ext_cmd(jid, 'S', imstatus2char[status], NULL);