--- a/mcabber/src/TODO Mon Apr 18 17:50:11 2005 +0000
+++ b/mcabber/src/TODO Mon Apr 18 18:12:50 2005 +0000
@@ -7,7 +7,6 @@
TODO:
-* Jabber agents support
* Display status
* show (how?) we can scroll in roster if not all buddies are displayed
@@ -26,6 +25,7 @@
- /status [online|avail|invisible|free|dnd|busy|notavail|away]
(and common shortcuts: /away, /online, /busy, /dnd)
- /rawxml...
+ - /search <\<jid\>|name>
* Command line history (^P/^N)
* External commands for events
* Multi-lines
@@ -36,4 +36,6 @@
* Shortcut to jump to next message received (shift-tab?)
* File transfer? :)
* Conferences :))
+* Show status changes in buddy window (if open)? Could be great!
+* Auto away
--- a/mcabber/src/jabglue.c Mon Apr 18 17:50:11 2005 +0000
+++ b/mcabber/src/jabglue.c Mon Apr 18 18:12:50 2005 +0000
@@ -398,7 +398,7 @@
void packethandler(jconn conn, jpacket packet)
{
- char *p;
+ char *p, *r;
xmlnode x, y;
// string from, type, body, enc, ns, id, u, h, s;
char *from=NULL, *type=NULL, *body=NULL, *enc=NULL;
@@ -406,7 +406,6 @@
char *id=NULL;
enum imstatus ust;
// int npos;
- // bool isagent;
jpacket_reset(packet);
@@ -627,9 +626,13 @@
if (type && !strcmp(type, "unavailable")) {
ust = offline;
}
- // scr_LogPrint("New status: ust=%d (%s)", ust, from);
- roster_setstatus(jidtodisp(from), ust); // XXX memory leak
+ r = jidtodisp(from);
+ if (ust != roster_getstatus(r))
+ scr_LogPrint("Buddy status has changed: [%c>%c] <%s>",
+ imstatus2char[roster_getstatus(r)], imstatus2char[ust], r);
+ roster_setstatus(r, ust);
+ free(r);
buddylist_build();
scr_DrawRoster();
/*
@@ -644,15 +647,19 @@
if (type) scr_LogPrint("Type=%s", type);
if (!strcmp(type, "subscribe")) {
- // if (!isagent) {
+ int isagent;
+ r = jidtodisp(from);
+ isagent = (roster_gettype(r) & ROSTER_TYPE_AGENT) != 0;
+ free(r);
+ scr_LogPrint("isagent=%d", isagent); // XXX DBG
+ if (!isagent) {
scr_LogPrint("<%s> wants to subscribe "
"to your network presence updates", from);
- /*} else {
- auto_ptr<char> cfrom(strdup(from.c_str()));
- x = jutil_presnew(JPACKET__SUBSCRIBED, cfrom.get(), 0);
+ } else {
+ x = jutil_presnew(JPACKET__SUBSCRIBED, from, 0);
jab_send(jc, x);
xmlnode_free(x);
- }*/
+ }
} else if (!strcmp(type, "unsubscribe")) {
x = jutil_presnew(JPACKET__UNSUBSCRIBED, from, 0);
jab_send(jc, x);