Mercurial > hg
comparison mcabber/src/commands.c @ 221:73f6ce668ba8
[/trunk] Changeset 233 by mikael
* /info now displays the current status message
author | mikael |
---|---|
date | Sat, 04 Jun 2005 12:47:13 +0000 |
parents | 4fcdbfdf7c20 |
children | d5ae42cbe1fa |
comparison
equal
deleted
inserted
replaced
220:8dfdc6f1778e | 221:73f6ce668ba8 |
---|---|
384 } | 384 } |
385 | 385 |
386 void do_info(char *arg) | 386 void do_info(char *arg) |
387 { | 387 { |
388 gpointer bud; | 388 gpointer bud; |
389 const char *jid, *name; | 389 const char *jid, *name, *st_msg; |
390 guint type; | 390 guint type; |
391 enum imstatus status; | 391 enum imstatus status; |
392 char *buffer; | 392 char *buffer; |
393 | 393 |
394 if (!current_buddy) return; | 394 if (!current_buddy) return; |
396 | 396 |
397 jid = buddy_getjid(bud); | 397 jid = buddy_getjid(bud); |
398 name = buddy_getname(bud); | 398 name = buddy_getname(bud); |
399 type = buddy_gettype(bud); | 399 type = buddy_gettype(bud); |
400 status = buddy_getstatus(bud); | 400 status = buddy_getstatus(bud); |
401 st_msg = buddy_getstatusmsg(bud); | |
401 | 402 |
402 buffer = g_new(char, 128); | 403 buffer = g_new(char, 128); |
403 | 404 |
404 if (jid) { | 405 if (jid) { |
405 char *typestr = "unknown"; | 406 char *typestr = "unknown"; |
408 scr_WriteIncomingMessage(jid, buffer, 0, HBB_PREFIX_INFO); | 409 scr_WriteIncomingMessage(jid, buffer, 0, HBB_PREFIX_INFO); |
409 if (name) { | 410 if (name) { |
410 snprintf(buffer, 127, "Name: %s", name); | 411 snprintf(buffer, 127, "Name: %s", name); |
411 scr_WriteIncomingMessage(jid, buffer, 0, HBB_PREFIX_INFO); | 412 scr_WriteIncomingMessage(jid, buffer, 0, HBB_PREFIX_INFO); |
412 } | 413 } |
414 if (st_msg) { | |
415 snprintf(buffer, 127, "Status message: %s", st_msg); | |
416 scr_WriteIncomingMessage(jid, buffer, 0, HBB_PREFIX_INFO); | |
417 } | |
413 | 418 |
414 if (type == ROSTER_TYPE_USER) typestr = "user"; | 419 if (type == ROSTER_TYPE_USER) typestr = "user"; |
415 else if (type == ROSTER_TYPE_AGENT) typestr = "agent"; | 420 else if (type == ROSTER_TYPE_AGENT) typestr = "agent"; |
416 | 421 |
417 snprintf(buffer, 127, "Type: %s", typestr); | 422 snprintf(buffer, 127, "Type: %s", typestr); |