[/trunk] Changeset 171 by mikael
* Use glib2 in jabglue.
* Switch status to offline when disconnecting.
--- a/mcabber/src/jabglue.c Sun May 01 20:28:11 2005 +0000
+++ b/mcabber/src/jabglue.c Mon May 02 09:33:32 2005 +0000
@@ -442,6 +442,7 @@
case JCONN_STATE_OFF:
online = FALSE;
+ mystatus = offline;
if (previous_state != JCONN_STATE_OFF) {
scr_LogPrint("+ JCONN_STATE_OFF");
@@ -501,7 +502,7 @@
if ((x = xmlnode_get_tag(packet->x, "subject")) != NULL)
if ((p = xmlnode_get_data(x)) != NULL) {
- tmp = malloc(strlen(body)+strlen(p)+3);
+ tmp = g_new(char, strlen(body)+strlen(p)+3);
*tmp = '[';
strcpy(tmp+1, p);
strcat(tmp, "]\n");
@@ -525,7 +526,7 @@
if (body)
gotmessage(type, from, body, enc);
if (tmp)
- free(tmp);
+ g_free(tmp);
}
break;
@@ -710,7 +711,7 @@
r = jidtodisp(from);
if (ust != roster_getstatus(r))
hk_statuschange(r, 0, ust);
- free(r);
+ g_free(r);
/*
if (x = xmlnode_get_tag(packet->x, "status"))
if (p = xmlnode_get_data(x))
@@ -726,7 +727,7 @@
int isagent;
r = jidtodisp(from);
isagent = (roster_gettype(r) & ROSTER_TYPE_AGENT) != 0;
- free(r);
+ g_free(r);
scr_LogPrint("isagent=%d", isagent); // XXX DBG
if (!isagent) {
scr_LogPrint("<%s> wants to subscribe "
--- a/mcabber/src/jabglue.h Sun May 01 20:28:11 2005 +0000
+++ b/mcabber/src/jabglue.h Mon May 02 09:33:32 2005 +0000
@@ -1,6 +1,8 @@
#ifndef __JABGLUE_H__
#define __JABGLUE_H__ 1
+#include <glib.h>
+
#include "../libjabber/jabber.h"
extern jconn jc;
--- a/mcabber/src/screen.c Sun May 01 20:28:11 2005 +0000
+++ b/mcabber/src/screen.c Mon May 02 09:33:32 2005 +0000
@@ -505,7 +505,6 @@
replace_panel(logPanel, logWnd);
replace_panel(logPanel_border, logWnd_border);
replace_panel(inputPanel, inputWnd);
- wprintw(logWnd, "This is a test\n");
}
// We'll need to redraw the roster