Mercurial > hg
comparison mcabber/src/jabglue.c @ 294:871e53769084
Allow one status message per Jabber status
Messages can be defined with the following options:
message (overrides any of the others),
message_avail,
message_free,
message_dnd,
message_notavail,
message_away
author | Mikael Berthe <mikael@lilotux.net> |
---|---|
date | Sat, 09 Jul 2005 12:44:57 +0100 |
parents | 4d7040cff8ee |
children | 35cda94e570d 12f919be3da5 |
comparison
equal
deleted
inserted
replaced
293:d0295e735768 | 294:871e53769084 |
---|---|
27 #include "roster.h" | 27 #include "roster.h" |
28 #include "screen.h" | 28 #include "screen.h" |
29 #include "hooks.h" | 29 #include "hooks.h" |
30 #include "utf8.h" | 30 #include "utf8.h" |
31 #include "utils.h" | 31 #include "utils.h" |
32 #include "settings.h" | |
32 | 33 |
33 #define JABBERPORT 5222 | 34 #define JABBERPORT 5222 |
34 #define JABBERSSLPORT 5223 | 35 #define JABBERSSLPORT 5223 |
35 | 36 |
36 #define JABBER_AGENT_GROUP "Jabber Agents" | 37 #define JABBER_AGENT_GROUP "Jabber Agents" |
224 inline enum imstatus jb_getstatus() | 225 inline enum imstatus jb_getstatus() |
225 { | 226 { |
226 return mystatus; | 227 return mystatus; |
227 } | 228 } |
228 | 229 |
229 void jb_setstatus(enum imstatus st, char *msg) | 230 void jb_setstatus(enum imstatus st, const char *msg) |
230 { | 231 { |
231 xmlnode x; | 232 xmlnode x; |
232 | 233 |
233 if (!online) return; | 234 if (!online) return; |
234 | 235 |
272 snprintf(strprio, 8, "%u", prio); | 273 snprintf(strprio, 8, "%u", prio); |
273 xmlnode_insert_cdata(xmlnode_insert_tag(x, "priority"), | 274 xmlnode_insert_cdata(xmlnode_insert_tag(x, "priority"), |
274 strprio, (unsigned) -1); | 275 strprio, (unsigned) -1); |
275 } | 276 } |
276 | 277 |
277 if (!msg) { | 278 if (!msg) |
278 msg = ""; // FIXME | 279 msg = settings_get_status_msg(st); |
279 //msg = imstatus2str(st); | |
280 } | |
281 | 280 |
282 xmlnode_insert_cdata(xmlnode_insert_tag(x, "status"), msg, | 281 xmlnode_insert_cdata(xmlnode_insert_tag(x, "status"), msg, |
283 (unsigned) -1); | 282 (unsigned) -1); |
284 | 283 |
285 jab_send(jc, x); | 284 jab_send(jc, x); |
432 //flogged = TRUE; | 431 //flogged = TRUE; |
433 //ourstatus = available; | 432 //ourstatus = available; |
434 | 433 |
435 //setautostatus(jhook.manualstatus); | 434 //setautostatus(jhook.manualstatus); |
436 | 435 |
437 jb_setstatus(available, "I'm here!"); // XXX not always "available"... | 436 jb_setstatus(available, NULL); |
438 buddylist_build(); | 437 buddylist_build(); |
439 /* | 438 /* |
440 for (i = 0; i < clist.count; i++) { | 439 for (i = 0; i < clist.count; i++) { |
441 c = (icqcontact *) clist.at(i); | 440 c = (icqcontact *) clist.at(i); |
442 | 441 |