You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(106) |
Oct
(334) |
Nov
(246) |
Dec
(145) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(42) |
Feb
(53) |
Mar
(232) |
Apr
(109) |
May
(137) |
Jun
(63) |
Jul
(26) |
Aug
(263) |
Sep
(193) |
Oct
(507) |
Nov
(440) |
Dec
(241) |
2003 |
Jan
(567) |
Feb
(195) |
Mar
(504) |
Apr
(481) |
May
(524) |
Jun
(522) |
Jul
(594) |
Aug
(502) |
Sep
(643) |
Oct
(508) |
Nov
(430) |
Dec
(377) |
2004 |
Jan
(361) |
Feb
(251) |
Mar
(219) |
Apr
(499) |
May
(461) |
Jun
(419) |
Jul
(314) |
Aug
(519) |
Sep
(416) |
Oct
(247) |
Nov
(305) |
Dec
(382) |
2005 |
Jan
(267) |
Feb
(282) |
Mar
(327) |
Apr
(338) |
May
(189) |
Jun
(400) |
Jul
(462) |
Aug
(530) |
Sep
(316) |
Oct
(523) |
Nov
(481) |
Dec
(650) |
2006 |
Jan
(536) |
Feb
(361) |
Mar
(287) |
Apr
(146) |
May
(101) |
Jun
(169) |
Jul
(221) |
Aug
(498) |
Sep
(300) |
Oct
(236) |
Nov
(209) |
Dec
(205) |
2007 |
Jan
(30) |
Feb
(23) |
Mar
(26) |
Apr
(15) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <fac...@us...> - 2006-06-10 18:10:47
|
Revision: 16242 Author: faceprint Date: 2006-06-10 11:10:39 -0700 (Sat, 10 Jun 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16242&view=rev Log Message: ----------- autotools continues to confuse me Modified Paths: -------------- branches/v2_0_0/configure.ac Modified: branches/v2_0_0/configure.ac =================================================================== --- branches/v2_0_0/configure.ac 2006-06-10 18:09:57 UTC (rev 16241) +++ branches/v2_0_0/configure.ac 2006-06-10 18:10:39 UTC (rev 16242) @@ -174,12 +174,12 @@ dnl ################# dnl # LibXML2 dnl ################# -enable_libxml=yes -PKG_CHECK_MODULES(LIBXML, libxml-2.0, ,enable_libxml=no) +enable_libxml2=yes +PKG_CHECK_MODULES(LIBXML, libxml-2.0, ,enable_libxml2=no) AC_SUBST(LIBXML_CFLAGS) AC_SUBST(LIBXML_LIBS) -AC_ARG_ENABLE(libxml,[ --disable-libxml compile without libxml2 support],enable_libxml=no) -if test "x$enable_libxml" = "xyes"; then +AC_ARG_ENABLE(libxml,[ --disable-libxml compile without libxml2 support],enable_libxml2=no) +if test "x$enable_libxml2" = "xyes"; then AC_DEFINE(HAVE_LIBXML, 1, [Use libxml2 for xml parsing]) fi @@ -1797,6 +1797,7 @@ eval echo DBUS servies directory........ : $DBUS_SERVICES_DIR fi echo Build with Cyrus SASL support. : $enable_cyrus_sasl +echo Build with libxml2 support.... : $enable_libxml2 echo Has you....................... : yes echo echo This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fac...@us...> - 2006-06-10 18:10:02
|
Revision: 16241 Author: faceprint Date: 2006-06-10 11:09:57 -0700 (Sat, 10 Jun 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16241&view=rev Log Message: ----------- autotools continues to confuse me Modified Paths: -------------- trunk/configure.ac Modified: trunk/configure.ac =================================================================== --- trunk/configure.ac 2006-06-10 18:01:11 UTC (rev 16240) +++ trunk/configure.ac 2006-06-10 18:09:57 UTC (rev 16241) @@ -174,12 +174,12 @@ dnl ################# dnl # LibXML2 dnl ################# -enable_libxml=yes -PKG_CHECK_MODULES(LIBXML, libxml-2.0, ,enable_libxml=no) +enable_libxml2=yes +PKG_CHECK_MODULES(LIBXML, libxml-2.0, ,enable_libxml2=no) AC_SUBST(LIBXML_CFLAGS) AC_SUBST(LIBXML_LIBS) -AC_ARG_ENABLE(libxml,[ --disable-libxml compile without libxml2 support],enable_libxml=no) -if test "x$enable_libxml" = "xyes"; then +AC_ARG_ENABLE(libxml,[ --disable-libxml compile without libxml2 support],enable_libxml2=no) +if test "x$enable_libxml2" = "xyes"; then AC_DEFINE(HAVE_LIBXML, 1, [Use libxml2 for xml parsing]) fi @@ -1797,6 +1797,7 @@ eval echo DBUS servies directory........ : $DBUS_SERVICES_DIR fi echo Build with Cyrus SASL support. : $enable_cyrus_sasl +echo Build with libxml2 support.... : $enable_libxml2 echo Has you....................... : yes echo echo This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ebl...@us...> - 2006-06-10 18:01:18
|
Revision: 16240 Author: eblanton Date: 2006-06-10 11:01:11 -0700 (Sat, 10 Jun 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16240&view=rev Log Message: ----------- This is not a completed update, but it has useful bits and bug fixes and the completed update will take some more time. This adds support for some of the status API to Tcl, as well as improving the handling of several of the pointer types (by introducing a gaim reference object type and appropriate string roundtrip functions) and introducing some "type safety". Modified Paths: -------------- trunk/plugins/tcl/Makefile.am trunk/plugins/tcl/tcl.c trunk/plugins/tcl/tcl_cmds.c trunk/plugins/tcl/tcl_gaim.h trunk/plugins/tcl/tcl_signals.c Modified: trunk/plugins/tcl/Makefile.am =================================================================== --- trunk/plugins/tcl/Makefile.am 2006-06-10 17:45:31 UTC (rev 16239) +++ trunk/plugins/tcl/Makefile.am 2006-06-10 18:01:11 UTC (rev 16240) @@ -4,7 +4,8 @@ plugin_LTLIBRARIES = tcl.la -tcl_la_SOURCES = tcl.c tcl_glib.c tcl_glib.h tcl_cmds.c tcl_signals.c tcl_gaim.h +tcl_la_SOURCES = tcl.c tcl_glib.c tcl_glib.h tcl_cmds.c tcl_signals.c tcl_gaim.h \ + tcl_ref.c EXTRA_DIST = signal-test.tcl Makefile.mingw Modified: trunk/plugins/tcl/tcl.c =================================================================== --- trunk/plugins/tcl/tcl.c 2006-06-10 17:45:31 UTC (rev 16239) +++ trunk/plugins/tcl/tcl.c 2006-06-10 18:01:11 UTC (rev 16240) @@ -50,6 +50,12 @@ Tcl_Interp *interp; }; +GaimStringref *GaimTclRefAccount; +GaimStringref *GaimTclRefConversation; +GaimStringref *GaimTclRefStatus; +GaimStringref *GaimTclRefStatusAttr; +GaimStringref *GaimTclRefStatusType; + static GHashTable *tcl_plugins = NULL; GaimPlugin *_tcl_plugin; @@ -125,6 +131,9 @@ Tcl_CreateObjCommand(interp, "::gaim::prefs", tcl_cmd_prefs, (ClientData)NULL, NULL); Tcl_CreateObjCommand(interp, "::gaim::send_im", tcl_cmd_send_im, (ClientData)NULL, NULL); Tcl_CreateObjCommand(interp, "::gaim::signal", tcl_cmd_signal, (ClientData)NULL, NULL); + Tcl_CreateObjCommand(interp, "::gaim::status", tcl_cmd_status_type, (ClientData)NULL, NULL); + Tcl_CreateObjCommand(interp, "::gaim::status_attr", tcl_cmd_status_type, (ClientData)NULL, NULL); + Tcl_CreateObjCommand(interp, "::gaim::status_type", tcl_cmd_status_type, (ClientData)NULL, NULL); Tcl_CreateObjCommand(interp, "::gaim::unload", tcl_cmd_unload, (ClientData)NULL, NULL); return 0; @@ -329,6 +338,14 @@ return FALSE; tcl_glib_init(); tcl_signal_init(); + gaim_tcl_ref_init(); + + GaimTclRefAccount = gaim_stringref_new("Account"); + GaimTclRefConversation = gaim_stringref_new("Conversation"); + GaimTclRefStatus = gaim_stringref_new("Status"); + GaimTclRefStatusAttr = gaim_stringref_new("StatusAttr"); + GaimTclRefStatusType = gaim_stringref_new("StatusType"); + tcl_plugins = g_hash_table_new(g_direct_hash, g_direct_equal); #ifdef HAVE_TK @@ -343,6 +360,12 @@ g_hash_table_destroy(tcl_plugins); tcl_plugins = NULL; + gaim_stringref_unref(GaimTclRefAccount); + gaim_stringref_unref(GaimTclRefConversation); + gaim_stringref_unref(GaimTclRefStatus); + gaim_stringref_unref(GaimTclRefStatusAttr); + gaim_stringref_unref(GaimTclRefStatusType); + return TRUE; } Modified: trunk/plugins/tcl/tcl_cmds.c =================================================================== --- trunk/plugins/tcl/tcl_cmds.c 2006-06-10 17:45:31 UTC (rev 16239) +++ trunk/plugins/tcl/tcl_cmds.c 2006-06-10 18:01:11 UTC (rev 16240) @@ -35,33 +35,46 @@ #include "tcl_gaim.h" -static gboolean tcl_validate_account(GaimAccount *account, Tcl_Interp *interp); -static gboolean tcl_validate_conversation(GaimConversation *convo, Tcl_Interp *interp); +static GaimAccount *tcl_validate_account(Tcl_Obj *obj, Tcl_Interp *interp); +static GaimConversation *tcl_validate_conversation(Tcl_Obj *obj, Tcl_Interp *interp); static gboolean tcl_validate_gc(GaimConnection *gc); -static gboolean tcl_validate_account(GaimAccount *account, Tcl_Interp *interp) +static GaimAccount *tcl_validate_account(Tcl_Obj *obj, Tcl_Interp *interp) { + GaimAccount *account; GList *cur; + + account = gaim_tcl_ref_get(interp, obj, GaimTclRefAccount); + + if (account == NULL) + return NULL; + for (cur = gaim_accounts_get_all(); cur != NULL; cur = g_list_next(cur)) { if (account == cur->data) - return TRUE; + return account; } if (interp != NULL) Tcl_SetStringObj(Tcl_GetObjResult(interp), "invalid account", -1); - return FALSE; + return NULL; } -static gboolean tcl_validate_conversation(GaimConversation *convo, Tcl_Interp *interp) +static GaimConversation *tcl_validate_conversation(Tcl_Obj *obj, Tcl_Interp *interp) { + GaimConversation *convo; GList *cur; + convo = gaim_tcl_ref_get(interp, obj, GaimTclRefConversation); + + if (convo == NULL) + return NULL; + for (cur = gaim_get_conversations(); cur != NULL; cur = g_list_next(cur)) { if (convo == cur->data) - return TRUE; + return convo; } if (interp != NULL) Tcl_SetStringObj(Tcl_GetObjResult(interp), "invalid account", -1); - return FALSE; + return NULL; } static gboolean tcl_validate_gc(GaimConnection *gc) @@ -77,19 +90,24 @@ int tcl_cmd_account(ClientData unused, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { Tcl_Obj *result = Tcl_GetObjResult(interp), *list, *elem; - const char *cmds[] = { "alias", "connect", "connection", "disconnect", "find", - "handle", "isconnected", "list", - "protocol", "username", NULL }; - enum { CMD_ACCOUNT_ALIAS, CMD_ACCOUNT_CONNECT, CMD_ACCOUNT_CONNECTION, - CMD_ACCOUNT_DISCONNECT, CMD_ACCOUNT_FIND, CMD_ACCOUNT_HANDLE, - CMD_ACCOUNT_ISCONNECTED, CMD_ACCOUNT_LIST, - CMD_ACCOUNT_PROTOCOL, CMD_ACCOUNT_USERNAME } cmd; + const char *cmds[] = { "active_status", "alias", "connect", + "connection", "disconnect", "enabled", "find", + "handle", "isconnected", "list", "protocol", + "status_type", "status_types", "username", NULL }; + enum { CMD_ACCOUNT_ACTIVE_STATUS, CMD_ACCOUNT_ALIAS, + CMD_ACCOUNT_CONNECT, CMD_ACCOUNT_CONNECTION, + CMD_ACCOUNT_DISCONNECT, CMD_ACCOUNT_ENABLED, CMD_ACCOUNT_FIND, + CMD_ACCOUNT_HANDLE, CMD_ACCOUNT_ISCONNECTED, CMD_ACCOUNT_LIST, + CMD_ACCOUNT_PROTOCOL, CMD_ACCOUNT_STATUS_TYPE, + CMD_ACCOUNT_STATUS_TYPES, CMD_ACCOUNT_USERNAME } cmd; const char *listopts[] = { "-all", "-online", NULL }; enum { CMD_ACCOUNTLIST_ALL, CMD_ACCOUNTLIST_ONLINE } listopt; const char *alias; - GList *cur; + const GList *cur; GaimAccount *account; + GaimStatusType *status_type; int error; + int b; if (objc < 2) { Tcl_WrongNumArgs(interp, 1, objv, "subcommand ?args?"); @@ -100,13 +118,23 @@ return error; switch (cmd) { + case CMD_ACCOUNT_ACTIVE_STATUS: + if (objc != 3) { + Tcl_WrongNumArgs(interp, 2, objv, "account"); + return TCL_ERROR; + } + if ((account = tcl_validate_account(objv[2], interp)) == NULL) + return TCL_ERROR; + Tcl_SetObjResult(interp, + gaim_tcl_ref_new(GaimTclRefStatus, + gaim_account_get_active_status(account))); + break; case CMD_ACCOUNT_ALIAS: if (objc != 3) { Tcl_WrongNumArgs(interp, 2, objv, "account"); return TCL_ERROR; } - error = Tcl_GetIntFromObj(interp, objv[2], (int *)&account); - if (error || !tcl_validate_account(account, interp)) + if ((account = tcl_validate_account(objv[2], interp)) == NULL) return TCL_ERROR; alias = gaim_account_get_alias(account); Tcl_SetStringObj(result, alias ? (char *)alias : "", -1); @@ -116,8 +144,7 @@ Tcl_WrongNumArgs(interp, 2, objv, "account"); return TCL_ERROR; } - error = Tcl_GetIntFromObj(interp, objv[2], (int *)&account); - if (error || !tcl_validate_account(account, interp)) + if ((account = tcl_validate_account(objv[2], interp)) == NULL) return TCL_ERROR; if (!gaim_account_is_connected(account)) gaim_account_connect(account); @@ -128,8 +155,8 @@ Tcl_WrongNumArgs(interp, 2, objv, "account"); return TCL_ERROR; } - error = Tcl_GetIntFromObj(interp, objv[2], (int *)&account); - if (error || !tcl_validate_account(account, interp)) + + if ((account = tcl_validate_account(objv[2], interp)) == NULL) return TCL_ERROR; Tcl_SetIntObj(result, (int)gaim_account_get_connection(account)); break; @@ -138,11 +165,27 @@ Tcl_WrongNumArgs(interp, 2, objv, "account"); return TCL_ERROR; } - error = Tcl_GetIntFromObj(interp, objv[2], (int *)&account); - if (error || !tcl_validate_account(account, interp)) + if ((account = tcl_validate_account(objv[2], interp)) == NULL) return TCL_ERROR; gaim_account_disconnect(account); break; + case CMD_ACCOUNT_ENABLED: + if (objc != 3 && objc != 4) { + Tcl_WrongNumArgs(interp, 2, objv, "account ?enabled?"); + return TCL_ERROR; + } + if ((account = tcl_validate_account(objv[2], interp)) == NULL) + return TCL_ERROR; + if (objc == 3) { + Tcl_SetBooleanObj(result, + gaim_account_get_enabled(account, + gaim_core_get_ui())); + } else { + if ((error = Tcl_GetBooleanFromObj(interp, objv[3], &b)) != TCL_OK) + return TCL_ERROR; + gaim_account_set_enabled(account, gaim_core_get_ui(), b); + } + break; case CMD_ACCOUNT_FIND: if (objc != 4) { Tcl_WrongNumArgs(interp, 2, objv, "username protocol"); @@ -163,8 +206,7 @@ Tcl_WrongNumArgs(interp, 2, objv, "account"); return TCL_ERROR; } - error = Tcl_GetIntFromObj(interp, objv[2], (int *)&account); - if (error || !tcl_validate_account(account, interp)) + if ((account = tcl_validate_account(objv[2], interp)) == NULL) return TCL_ERROR; Tcl_SetBooleanObj(result, gaim_account_is_connected(account)); break; @@ -183,7 +225,7 @@ account = cur->data; if (listopt == CMD_ACCOUNTLIST_ONLINE && !gaim_account_is_connected(account)) continue; - elem = Tcl_NewIntObj((int)account); + elem = gaim_tcl_ref_new(GaimTclRefAccount, account); Tcl_ListObjAppendElement(interp, list, elem); } Tcl_SetObjResult(interp, list); @@ -193,18 +235,63 @@ Tcl_WrongNumArgs(interp, 2, objv, "account"); return TCL_ERROR; } - error = Tcl_GetIntFromObj(interp, objv[2], (int *)&account); - if (error || !tcl_validate_account(account, interp)) + if ((account = tcl_validate_account(objv[2], interp)) == NULL) return TCL_ERROR; Tcl_SetStringObj(result, (char *)gaim_account_get_protocol_id(account), -1); break; + case CMD_ACCOUNT_STATUS_TYPE: + if (objc != 4 && objc != 5) { + Tcl_WrongNumArgs(interp, 2, objv, "account ?statustype? ?-primitive primitive?"); + return TCL_ERROR; + } + if ((account = tcl_validate_account(objv[2], interp)) == NULL) + return TCL_ERROR; + if (objc == 4) { + status_type = gaim_account_get_status_type(account, + Tcl_GetString(objv[3])); + } else { + GaimStatusPrimitive primitive; + if (strcmp(Tcl_GetString(objv[3]), "-primitive")) { + Tcl_SetStringObj(result, "bad option \"", -1); + Tcl_AppendObjToObj(result, objv[3]); + Tcl_AppendToObj(result, + "\": should be -primitive", -1); + return TCL_ERROR; + } + primitive = gaim_primitive_get_type_from_id(Tcl_GetString(objv[4])); + status_type = gaim_account_get_status_type_with_primitive(account, + primitive); + } + if (status_type == NULL) { + Tcl_SetStringObj(result, "status type not found", -1); + return TCL_ERROR; + } + Tcl_SetObjResult(interp, + gaim_tcl_ref_new(GaimTclRefStatusType, + status_type)); + break; + case CMD_ACCOUNT_STATUS_TYPES: + if (objc != 3) { + Tcl_WrongNumArgs(interp, 2, objv, "account"); + return TCL_ERROR; + } + if ((account = tcl_validate_account(objv[2], interp)) == NULL) + return TCL_ERROR; + list = Tcl_NewListObj(0, NULL); + for (cur = gaim_account_get_status_types(account); cur != NULL; + cur = g_list_next(cur)) { + Tcl_ListObjAppendElement(interp, list, + gaim_tcl_ref_new(GaimTclRefStatusType, + cur->data)); + } + Tcl_SetObjResult(interp, list); + break; case CMD_ACCOUNT_USERNAME: if (objc != 3) { Tcl_WrongNumArgs(interp, 2, objv, "account"); return TCL_ERROR; } - error = Tcl_GetIntFromObj(interp, objv[2], (int *)&account); - if (error || !tcl_validate_account(account, interp)) + if ((account = tcl_validate_account(objv[2], interp)) == NULL) return TCL_ERROR; Tcl_SetStringObj(result, (char *)gaim_account_get_username(account), -1); break; @@ -227,10 +314,8 @@ type = Tcl_GetString(elems[0]); name = Tcl_GetString(elems[1]); - if (Tcl_GetIntFromObj(interp, elems[2], (int *)&account) != TCL_OK) + if ((account = tcl_validate_account(elems[2], interp)) == NULL) return NULL; - if (!tcl_validate_account(account, interp)) - return NULL; if (!strcmp(type, "buddy")) { node = (GaimBlistNode *)gaim_find_buddy(account, name); @@ -301,15 +386,11 @@ Tcl_SetStringObj(result, "invalid buddy", -1); return TCL_ERROR; } - if ((error = Tcl_GetIntFromObj(interp, elems[2], (int *)&account)) != TCL_OK) + if ((account = tcl_validate_account(elems[2], interp)) == NULL) return TCL_ERROR; - if (!tcl_validate_account(account, interp)) - return TCL_ERROR; serv_get_info(gaim_account_get_connection(account), Tcl_GetString(elems[1])); } else { - if ((error = Tcl_GetIntFromObj(interp, objv[2], (int *)&account)) != TCL_OK) - return error; - if (!tcl_validate_account(account, interp)) + if ((account = tcl_validate_account(objv[2], interp)) == NULL) return TCL_ERROR; serv_get_info(gaim_account_get_connection(account), Tcl_GetString(objv[3])); } @@ -351,7 +432,7 @@ tclbud = Tcl_NewListObj(0, NULL); Tcl_ListObjAppendElement(interp, tclbud, Tcl_NewStringObj("buddy", -1)); Tcl_ListObjAppendElement(interp, tclbud, Tcl_NewStringObj(bud->name, -1)); - Tcl_ListObjAppendElement(interp, tclbud, Tcl_NewIntObj((int)bud->account)); + Tcl_ListObjAppendElement(interp, tclbud, gaim_tcl_ref_new(GaimTclRefAccount, bud->account)); Tcl_ListObjAppendElement(interp, tclcontactlist, tclbud); } if (count) { @@ -368,7 +449,7 @@ tclbud = Tcl_NewListObj(0, NULL); Tcl_ListObjAppendElement(interp, tclbud, Tcl_NewStringObj("chat", -1)); Tcl_ListObjAppendElement(interp, tclbud, Tcl_NewStringObj(cnode->alias, -1)); - Tcl_ListObjAppendElement(interp, tclbud, Tcl_NewIntObj((int)cnode->account)); + Tcl_ListObjAppendElement(interp, tclbud, gaim_tcl_ref_new(GaimTclRefAccount, cnode->account)); Tcl_ListObjAppendElement(interp, tclgrouplist, tclbud); break; default: @@ -483,10 +564,7 @@ return TCL_ERROR; } account = NULL; - if ((error = Tcl_GetIntFromObj(interp, objv[2], - (int *)&account)) != TCL_OK) - return error; - if (!tcl_validate_account(account, interp)) + if ((account = tcl_validate_account(objv[2], interp)) == NULL) return TCL_ERROR; convo = gaim_find_conversation_with_account(GAIM_CONV_TYPE_ANY, Tcl_GetString(objv[3]), @@ -538,9 +616,7 @@ Tcl_WrongNumArgs(interp, 2, objv, "?options? account name"); return TCL_ERROR; } - if ((error = Tcl_GetIntFromObj(interp, objv[argsused++], (int *)&account)) != TCL_OK) - return error; - if (!tcl_validate_account(account, interp)) + if ((account = tcl_validate_account(objv[argsused++], interp)) == NULL) return TCL_ERROR; convo = gaim_conversation_new(type, account, Tcl_GetString(objv[argsused])); Tcl_SetIntObj(result, (int)convo); @@ -550,12 +626,10 @@ Tcl_WrongNumArgs(interp, 2, objv, "conversation style from what"); return TCL_ERROR; } - if ((error = Tcl_GetIntFromObj(interp, objv[2], (int *)&convo)) != TCL_OK) - return error; + if ((convo = tcl_validate_conversation(objv[2], interp)) == NULL) + return TCL_ERROR; if ((error = Tcl_GetIndexFromObj(interp, objv[3], styles, "style", 0, (int *)&style)) != TCL_OK) return error; - if (!tcl_validate_conversation(convo, interp)) - return TCL_ERROR; from = Tcl_GetString(objv[4]); what = Tcl_GetString(objv[5]); @@ -856,6 +930,7 @@ return error; } handler->signal = objv[3]; + Tcl_IncrRefCount(handler->signal); handler->args = objv[4]; handler->proc = objv[5]; handler->interp = interp; @@ -868,7 +943,7 @@ break; case CMD_SIGNAL_DISCONNECT: if (objc != 4) { - Tcl_WrongNumArgs(interp, 2, objv, "signal"); + Tcl_WrongNumArgs(interp, 2, objv, "instance signal"); return TCL_ERROR; } if ((error = Tcl_GetIntFromObj(interp, objv[2], (int *)&instance)) != TCL_OK) @@ -880,6 +955,248 @@ return TCL_OK; } +int tcl_cmd_status(ClientData unused, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) +{ + const char *cmds[] = { "attr", "type" }; + enum { CMD_STATUS_ATTR, CMD_STATUS_TYPE } cmd; + Tcl_Obj *result = Tcl_GetObjResult(interp); + GaimStatus *status; + GaimStatusType *status_type; + GaimValue *value; + int error; + + if (objc < 2) { + Tcl_WrongNumArgs(interp, 1, objv, "subcommand ?args?"); + return TCL_ERROR; + } + + if ((error = Tcl_GetIndexFromObj(interp, objv[1], cmds, "subcommand", 0, (int *)&cmd)) != TCL_OK) + return error; + + switch (cmd) { + case CMD_STATUS_ATTR: + if (objc != 4) { + Tcl_WrongNumArgs(interp, 2, objv, "status attr_id"); + return TCL_ERROR; + } + if ((status = gaim_tcl_ref_get(interp, objv[2], GaimTclRefStatus)) == NULL) + return TCL_ERROR; + value = gaim_status_get_attr_value(status, Tcl_GetString(objv[3])); + if (value == NULL) { + Tcl_SetStringObj(result, "no such attribute", -1); + return TCL_ERROR; + } + switch (gaim_value_get_type(value)) { + case GAIM_TYPE_BOOLEAN: + Tcl_SetBooleanObj(result, gaim_value_get_boolean(value)); + break; + case GAIM_TYPE_INT: + Tcl_SetIntObj(result, gaim_value_get_int(value)); + break; + case GAIM_TYPE_STRING: + Tcl_SetStringObj(result, gaim_value_get_string(value), -1); + break; + default: + Tcl_SetStringObj(result, "attribute has unknown type", -1); + return TCL_ERROR; + } + break; + case CMD_STATUS_TYPE: + if (objc != 3) { + Tcl_WrongNumArgs(interp, 2, objv, "status"); + return TCL_ERROR; + } + if ((status = gaim_tcl_ref_get(interp, objv[2], GaimTclRefStatus)) == NULL) + return TCL_ERROR; + status_type = gaim_status_get_type(status); + Tcl_SetObjResult(interp, gaim_tcl_ref_new(GaimTclRefStatusType, + status_type)); + break; + } + + return TCL_OK; +} + +int tcl_cmd_status_attr(ClientData unused, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) +{ + const char *cmds[] = { "id", "name", NULL }; + enum { CMD_STATUS_ATTR_ID, CMD_STATUS_ATTR_NAME } cmd; + Tcl_Obj *result = Tcl_GetObjResult(interp); + GaimStatusAttr *attr; + int error; + + if (objc < 2) { + Tcl_WrongNumArgs(interp, 1, objv, "subcommand ?args?"); + return TCL_ERROR; + } + + if ((error = Tcl_GetIndexFromObj(interp, objv[1], cmds, "subcommand", 0, (int *)&cmd)) != TCL_OK) + return error; + + switch (cmd) { + case CMD_STATUS_ATTR_ID: + if (objc != 3) { + Tcl_WrongNumArgs(interp, 2, objv, "attr"); + return TCL_ERROR; + } + if ((attr = gaim_tcl_ref_get(interp, objv[2], GaimTclRefStatusAttr)) == NULL) + return TCL_ERROR; + Tcl_SetStringObj(result, gaim_status_attr_get_id(attr), -1); + break; + case CMD_STATUS_ATTR_NAME: + if (objc != 3) { + Tcl_WrongNumArgs(interp, 2, objv, "attr"); + return TCL_ERROR; + } + if ((attr = gaim_tcl_ref_get(interp, objv[2], GaimTclRefStatusAttr)) == NULL) + return TCL_ERROR; + Tcl_SetStringObj(result, gaim_status_attr_get_name(attr), -1); + break; + } + + return TCL_OK; +} + +int tcl_cmd_status_type(ClientData unused, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) +{ + const char *cmds[] = { "attr", "attrs", "available", "exclusive", "id", + "independent", "name", "primary_attr", + "primitive", "saveable", "user_settable", + NULL }; + enum { CMD_STATUS_TYPE_ATTR, CMD_STATUS_TYPE_ATTRS, + CMD_STATUS_TYPE_AVAILABLE, CMD_STATUS_TYPE_EXCLUSIVE, + CMD_STATUS_TYPE_ID, CMD_STATUS_TYPE_INDEPENDENT, + CMD_STATUS_TYPE_NAME, CMD_STATUS_TYPE_PRIMARY_ATTR, + CMD_STATUS_TYPE_PRIMITIVE, CMD_STATUS_TYPE_SAVEABLE, + CMD_STATUS_TYPE_USER_SETTABLE } cmd; + Tcl_Obj *result = Tcl_GetObjResult(interp); + GaimStatusType *status_type; + Tcl_Obj *list, *elem; + const GList *cur; + int error; + + if (objc < 2) { + Tcl_WrongNumArgs(interp, 1, objv, "subcommand ?args?"); + return TCL_ERROR; + } + + if ((error = Tcl_GetIndexFromObj(interp, objv[1], cmds, "subcommand", 0, (int *)&cmd)) != TCL_OK) + return error; + + switch (cmd) { + case CMD_STATUS_TYPE_AVAILABLE: + if (objc != 3) { + Tcl_WrongNumArgs(interp, 2, objv, "statustype"); + return TCL_ERROR; + } + if ((status_type = gaim_tcl_ref_get(interp, objv[2], GaimTclRefStatusType)) == NULL) + return TCL_ERROR; + Tcl_SetBooleanObj(result, gaim_status_type_is_available(status_type)); + break; + case CMD_STATUS_TYPE_ATTR: + if (objc != 4) { + Tcl_WrongNumArgs(interp, 2, objv, "statustype attr"); + return TCL_ERROR; + } + if ((status_type = gaim_tcl_ref_get(interp, objv[2], GaimTclRefStatusType)) == NULL) + return TCL_ERROR; + Tcl_SetObjResult(interp, + gaim_tcl_ref_new(GaimTclRefStatusAttr, + gaim_status_type_get_attr(status_type, + Tcl_GetStringFromObj(objv[3], NULL)))); + break; + case CMD_STATUS_TYPE_ATTRS: + if (objc != 3) { + Tcl_WrongNumArgs(interp, 2, objv, "statustype"); + return TCL_ERROR; + } + if ((status_type = gaim_tcl_ref_get(interp, objv[2], GaimTclRefStatusType)) == NULL) + return TCL_ERROR; + list = Tcl_NewListObj(0, NULL); + for (cur = gaim_status_type_get_attrs(status_type); + cur != NULL; cur = g_list_next(cur)) { + elem = gaim_tcl_ref_new(GaimTclRefStatusAttr, cur->data); + Tcl_ListObjAppendElement(interp, list, elem); + } + Tcl_SetObjResult(interp, list); + break; + case CMD_STATUS_TYPE_EXCLUSIVE: + if (objc != 3) { + Tcl_WrongNumArgs(interp, 2, objv, "statustype"); + return TCL_ERROR; + } + if ((status_type = gaim_tcl_ref_get(interp, objv[2], GaimTclRefStatusType)) == NULL) + return TCL_ERROR; + Tcl_SetBooleanObj(result, gaim_status_type_is_exclusive(status_type)); + break; + case CMD_STATUS_TYPE_ID: + if (objc != 3) { + Tcl_WrongNumArgs(interp, 2, objv, "statustype"); + return TCL_ERROR; + } + if ((status_type = gaim_tcl_ref_get(interp, objv[2], GaimTclRefStatusType)) == NULL) + return TCL_ERROR; + Tcl_SetStringObj(result, gaim_status_type_get_id(status_type), -1); + break; + case CMD_STATUS_TYPE_INDEPENDENT: + if (objc != 3) { + Tcl_WrongNumArgs(interp, 2, objv, "statustype"); + return TCL_ERROR; + } + if ((status_type = gaim_tcl_ref_get(interp, objv[2], GaimTclRefStatusType)) == NULL) + return TCL_ERROR; + Tcl_SetBooleanObj(result, gaim_status_type_is_independent(status_type)); + break; + case CMD_STATUS_TYPE_NAME: + if (objc != 3) { + Tcl_WrongNumArgs(interp, 2, objv, "statustype"); + return TCL_ERROR; + } + if ((status_type = gaim_tcl_ref_get(interp, objv[2], GaimTclRefStatusType)) == NULL) + return TCL_ERROR; + Tcl_SetStringObj(result, gaim_status_type_get_name(status_type), -1); + break; + case CMD_STATUS_TYPE_PRIMITIVE: + if (objc != 3) { + Tcl_WrongNumArgs(interp, 2, objv, "statustype"); + return TCL_ERROR; + } + if ((status_type = gaim_tcl_ref_get(interp, objv[2], GaimTclRefStatusType)) == NULL) + return TCL_ERROR; + Tcl_SetStringObj(result, gaim_primitive_get_id_from_type(gaim_status_type_get_primitive(status_type)), -1); + break; + case CMD_STATUS_TYPE_PRIMARY_ATTR: + if (objc != 3) { + Tcl_WrongNumArgs(interp, 2, objv, "statustype"); + return TCL_ERROR; + } + if ((status_type = gaim_tcl_ref_get(interp, objv[2], GaimTclRefStatusType)) == NULL) + return TCL_ERROR; + Tcl_SetStringObj(result, gaim_status_type_get_primary_attr(status_type), -1); + break; + case CMD_STATUS_TYPE_SAVEABLE: + if (objc != 3) { + Tcl_WrongNumArgs(interp, 2, objv, "statustype"); + return TCL_ERROR; + } + if ((status_type = gaim_tcl_ref_get(interp, objv[2], GaimTclRefStatusType)) == NULL) + return TCL_ERROR; + Tcl_SetBooleanObj(result, gaim_status_type_is_saveable(status_type)); + break; + case CMD_STATUS_TYPE_USER_SETTABLE: + if (objc != 3) { + Tcl_WrongNumArgs(interp, 2, objv, "statustype"); + return TCL_ERROR; + } + if ((status_type = gaim_tcl_ref_get(interp, objv[2], GaimTclRefStatusType)) == NULL) + return TCL_ERROR; + Tcl_SetBooleanObj(result, gaim_status_type_is_user_settable(status_type)); + break; + } + + return TCL_OK; +} + static gboolean unload_self(gpointer data) { GaimPlugin *plugin = data; Modified: trunk/plugins/tcl/tcl_gaim.h =================================================================== --- trunk/plugins/tcl/tcl_gaim.h 2006-06-10 17:45:31 UTC (rev 16239) +++ trunk/plugins/tcl/tcl_gaim.h 2006-06-10 18:01:11 UTC (rev 16240) @@ -28,6 +28,7 @@ #include "internal.h" #include "plugin.h" #include "value.h" +#include "stringref.h" struct tcl_signal_handler { Tcl_Obj *signal; @@ -46,6 +47,13 @@ extern GaimPlugin *_tcl_plugin; +/* Capitalized this way because these are "types" */ +extern GaimStringref *GaimTclRefAccount; +extern GaimStringref *GaimTclRefConversation; +extern GaimStringref *GaimTclRefStatus; +extern GaimStringref *GaimTclRefStatusAttr; +extern GaimStringref *GaimTclRefStatusType; + GaimPlugin *tcl_interp_get_plugin(Tcl_Interp *interp); void tcl_signal_init(void); @@ -54,6 +62,10 @@ gboolean tcl_signal_connect(struct tcl_signal_handler *handler); void tcl_signal_disconnect(void *instance, const char *signal, Tcl_Interp *interp); +void gaim_tcl_ref_init(); +void *gaim_tcl_ref_get(Tcl_Interp *interp, Tcl_Obj *obj, GaimStringref *type); +Tcl_Obj *gaim_tcl_ref_new(GaimStringref *type, void *value); + Tcl_ObjCmdProc tcl_cmd_account; Tcl_ObjCmdProc tcl_cmd_signal_connect; Tcl_ObjCmdProc tcl_cmd_buddy; @@ -65,6 +77,9 @@ Tcl_ObjCmdProc tcl_cmd_prefs; Tcl_ObjCmdProc tcl_cmd_send_im; Tcl_ObjCmdProc tcl_cmd_signal; +Tcl_ObjCmdProc tcl_cmd_status; +Tcl_ObjCmdProc tcl_cmd_status_attr; +Tcl_ObjCmdProc tcl_cmd_status_type; Tcl_ObjCmdProc tcl_cmd_unload; #endif /* _GAIM_TCL_GAIM_H_ */ Modified: trunk/plugins/tcl/tcl_signals.c =================================================================== --- trunk/plugins/tcl/tcl_signals.c 2006-06-10 17:45:31 UTC (rev 16239) +++ trunk/plugins/tcl/tcl_signals.c 2006-06-10 18:01:11 UTC (rev 16240) @@ -48,7 +48,8 @@ return; Tcl_DecrRefCount(handler->signal); - Tcl_DecrRefCount(handler->namespace); + if (handler->namespace) + Tcl_DecrRefCount(handler->namespace); g_free(handler); } @@ -86,7 +87,6 @@ (void *)handler)) return FALSE; - Tcl_IncrRefCount(handler->signal); handler->namespace = new_cb_namespace (); Tcl_IncrRefCount(handler->namespace); proc = g_string_new(""); @@ -256,8 +256,12 @@ case GAIM_SUBTYPE_UNKNOWN: gaim_debug(GAIM_DEBUG_ERROR, "tcl", "subtype unknown\n"); case GAIM_SUBTYPE_ACCOUNT: + case GAIM_SUBTYPE_CONVERSATION: + if (gaim_value_is_outgoing(handler->argtypes[i])) + gaim_debug_error("tcl", "pointer subtypes do not currently support outgoing arguments\n"); + arg = gaim_tcl_ref_new(GaimTclRefAccount, va_arg(args, void *)); + break; case GAIM_SUBTYPE_CONNECTION: - case GAIM_SUBTYPE_CONVERSATION: case GAIM_SUBTYPE_PLUGIN: case GAIM_SUBTYPE_XFER: /* pointers again */ @@ -281,24 +285,40 @@ node = va_arg(args, GaimBlistNode *); switch (node->type) { case GAIM_BLIST_GROUP_NODE: - g_string_printf(val, "group {%s}", ((GaimGroup *)node)->name); + arg = Tcl_NewListObj(0, NULL); + Tcl_ListObjAppendElement(handler->interp, arg, + Tcl_NewStringObj("group", -1)); + Tcl_ListObjAppendElement(handler->interp, arg, + Tcl_NewStringObj(((GaimGroup *)node)->name, -1)); break; case GAIM_BLIST_CONTACT_NODE: /* g_string_printf(val, "contact {%s}", Contact Name? ); */ + arg = Tcl_NewStringObj("contact", -1); break; case GAIM_BLIST_BUDDY_NODE: - g_string_printf(val, "buddy {%s} %lu", ((GaimBuddy *)node)->name, - (unsigned long)((GaimBuddy *)node)->account); + arg = Tcl_NewListObj(0, NULL); + Tcl_ListObjAppendElement(handler->interp, arg, + Tcl_NewStringObj("buddy", -1)); + Tcl_ListObjAppendElement(handler->interp, arg, + Tcl_NewStringObj(((GaimBuddy *)node)->name, -1)); + Tcl_ListObjAppendElement(handler->interp, arg, + gaim_tcl_ref_new(GaimTclRefAccount, + ((GaimBuddy *)node)->account)); break; case GAIM_BLIST_CHAT_NODE: - g_string_printf(val, "chat {%s} %lu", ((GaimChat *)node)->alias, - (unsigned long)((GaimChat *)node)->account); + arg = Tcl_NewListObj(0, NULL); + Tcl_ListObjAppendElement(handler->interp, arg, + Tcl_NewStringObj("chat", -1)); + Tcl_ListObjAppendElement(handler->interp, arg, + Tcl_NewStringObj(((GaimChat *)node)->alias, -1)); + Tcl_ListObjAppendElement(handler->interp, arg, + gaim_tcl_ref_new(GaimTclRefAccount, + ((GaimChat *)node)->account)); break; case GAIM_BLIST_OTHER_NODE: - g_string_printf(val, "other"); + arg = Tcl_NewStringObj("other", -1); break; } - arg = Tcl_NewStringObj(val->str, -1); break; } } @@ -329,8 +349,10 @@ for (i = 0; i < handler->nargs; i++) { g_string_printf(name, "%s::arg%d", Tcl_GetString(handler->namespace), i); - if (gaim_value_is_outgoing(handler->argtypes[i])) + if (gaim_value_is_outgoing(handler->argtypes[i]) + && gaim_value_get_type(handler->argtypes[i]) != GAIM_TYPE_SUBTYPE) Tcl_UnlinkVar(handler->interp, name->str); + /* We basically only have to deal with strings on the * way out */ switch (gaim_value_get_type(handler->argtypes[i])) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fac...@us...> - 2006-06-10 17:45:36
|
Revision: 16239 Author: faceprint Date: 2006-06-10 10:45:31 -0700 (Sat, 10 Jun 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16239&view=rev Log Message: ----------- this should be in 2.0.0 as well Modified Paths: -------------- branches/v2_0_0/configure.ac Modified: branches/v2_0_0/configure.ac =================================================================== --- branches/v2_0_0/configure.ac 2006-06-10 17:39:15 UTC (rev 16238) +++ branches/v2_0_0/configure.ac 2006-06-10 17:45:31 UTC (rev 16239) @@ -178,6 +178,7 @@ PKG_CHECK_MODULES(LIBXML, libxml-2.0, ,enable_libxml=no) AC_SUBST(LIBXML_CFLAGS) AC_SUBST(LIBXML_LIBS) +AC_ARG_ENABLE(libxml,[ --disable-libxml compile without libxml2 support],enable_libxml=no) if test "x$enable_libxml" = "xyes"; then AC_DEFINE(HAVE_LIBXML, 1, [Use libxml2 for xml parsing]) fi This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fac...@us...> - 2006-06-10 17:39:23
|
Revision: 16238 Author: faceprint Date: 2006-06-10 10:39:15 -0700 (Sat, 10 Jun 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16238&view=rev Log Message: ----------- let you disable libxml2 support Modified Paths: -------------- trunk/configure.ac Modified: trunk/configure.ac =================================================================== --- trunk/configure.ac 2006-06-08 15:35:37 UTC (rev 16237) +++ trunk/configure.ac 2006-06-10 17:39:15 UTC (rev 16238) @@ -178,6 +178,7 @@ PKG_CHECK_MODULES(LIBXML, libxml-2.0, ,enable_libxml=no) AC_SUBST(LIBXML_CFLAGS) AC_SUBST(LIBXML_LIBS) +AC_ARG_ENABLE(libxml,[ --disable-libxml compile without libxml2 support],enable_libxml=no) if test "x$enable_libxml" = "xyes"; then AC_DEFINE(HAVE_LIBXML, 1, [Use libxml2 for xml parsing]) fi This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dat...@us...> - 2006-06-08 15:35:45
|
Revision: 16237 Author: datallah Date: 2006-06-08 08:35:37 -0700 (Thu, 08 Jun 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16237&view=rev Log Message: ----------- Update win32 build instructions for the libxml2 stuff. Add a link to the skins page from the faq. Modified Paths: -------------- web/htdocs/faq.txt web/htdocs/faq2.txt web/htdocs/win32/build.php Modified: web/htdocs/faq.txt =================================================================== --- web/htdocs/faq.txt 2006-06-08 15:20:38 UTC (rev 16236) +++ web/htdocs/faq.txt 2006-06-08 15:35:37 UTC (rev 16237) @@ -1339,4 +1339,9 @@ it onto a Gaim window). </p> +Q: Can I "skin" Gaim? + +A: The UI can be customized using GTK themes. Read <a +href="http://gaim.sourceforge.net/skins.php">this</a> for more information. + !COMMENT vim: syntax=gaimfaq tw=75 Modified: web/htdocs/faq2.txt =================================================================== --- web/htdocs/faq2.txt 2006-06-08 15:20:38 UTC (rev 16236) +++ web/htdocs/faq2.txt 2006-06-08 15:35:37 UTC (rev 16237) @@ -1196,4 +1196,9 @@ it onto a Gaim window). </p> +Q: Can I "skin" Gaim? + +A: The UI can be customized using GTK themes. Read <a +href="http://gaim.sourceforge.net/skins.php">this</a> for more information. + !COMMENT vim: syntax=gaimfaq tw=75 Modified: web/htdocs/win32/build.php =================================================================== --- web/htdocs/win32/build.php 2006-06-08 15:20:38 UTC (rev 16236) +++ web/htdocs/win32/build.php 2006-06-08 15:35:37 UTC (rev 16237) @@ -17,7 +17,7 @@ </li> <li> <p> -Download the <a href="http://gaim-extprefs.sourceforge.net/bef.shtml">WinGaim Build Environment Fetcher</a> script. Follow the instructions on the website to fetch and install most of the needed build dependencies. The script can fetch Gaim's source code from either anonymous CVS or a source distribution; you will be prompted to choose which you'd like to use. +Download the <a href="http://gaim-extprefs.sourceforge.net/bef.shtml">WinGaim Build Environment Fetcher</a> script. Follow the instructions on the website to fetch and install most of the needed build dependencies. The script can fetch Gaim's source code from either Subversion or a source distribution; you will be prompted to choose which you'd like to use. </p> </li> <li> @@ -58,8 +58,11 @@ <h2>Install Gaim's build dependencies</h2> <dl> <dt>GTK+</dt> -<dd>Gaim depends on GTK+ <?php print $current_win32_gtk_version; ?>. For your convenience I have included all of GTK's dependencies in one tarball. Extract <a href="http://prdownloads.sourceforge.net/gaim/gtk-dev-<?php print $current_win32_gtk_version; ?>-rev-<?php print $current_win32_gtk_revision; ?>.tar.gz">gtk-dev-<?php print $current_win32_gtk_version; ?>-rev-<?php print $current_win32_gtk_revision; ?>.tar.gz</a> from within <code>~/win32-dev</code>. If once built you wish to run Gaim from the win32-install-dir dir, you will need to make sure that you have installed the GTK+ runtime, and make sure that its bin dir is in your PATH. Visit the <a href="http://www.gtk.org">GTK+ website</a> for official binary and source releases.</dd> +<dd>Gaim depends on GTK+ <?php print $current_win32_gtk_version; ?>. For your convenience, we have included all of GTK's dependencies in one tarball. Extract <a href="http://prdownloads.sourceforge.net/gaim/gtk-dev-<?php print $current_win32_gtk_version; ?>-rev-<?php print $current_win32_gtk_revision; ?>.tar.gz">gtk-dev-<?php print $current_win32_gtk_version; ?>-rev-<?php print $current_win32_gtk_revision; ?>.tar.gz</a> from within <code>~/win32-dev</code>. If once built you wish to run Gaim from the win32-install-dir dir, you will need to make sure that you have installed the GTK+ runtime, and make sure that its bin dir is in your PATH. Visit the <a href="http://www.gtk.org">GTK+ website</a> for official binary and source releases.</dd> +<dt>Libxml2</td> +<dd>Download and extract <a href="libxml2-2.6.24.tar.gz">libxml2-2.6.24.tar.gz</a> to <code>win32-dev</code>.</dd> + <dt>Perl 5.8</dt> <dd>Install Perl 5.8 for Windows (I use <a href="http://www.activestate.com/Products/Language_Distributions/">ActivePerl</a>), to <code>C:\Perl</code>. If you install Perl anywhere else, you will need to change the <code>PERL</code> and <code>EXTUTILS</code> variables in <code>gaim/plugins/perl/common/Makefile.mingw</code>. You will also need to install <a href="perl582.tar.gz">perl582.tar.gz</a> under <code>~/win32-dev</code> (Containing altered headers and import lib).</dd> @@ -96,7 +99,7 @@ <h2>Get the Gaim source code</h2> <ul> - <li>Sources are in <a href="http://gaim.sourceforge.net/downloads.php">CVS</a></li> + <li>Sources are in <a href="http://gaim.sourceforge.net/downloads.php">Subversion</a></li> <li><a href="http://prdownloads.sourceforge.net/gaim/gaim-<?php print $current_win32_version; ?>.tar.gz">Windows Gaim v<?php print $current_win32_version; ?> sources</a></li> </ul> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dat...@us...> - 2006-06-08 15:20:46
|
Revision: 16236 Author: datallah Date: 2006-06-08 08:20:38 -0700 (Thu, 08 Jun 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16236&view=rev Log Message: ----------- Backport of 16234:16235. ----------------------------------------------------- Use libxml2 on win32 too. This increases the installer size by ~400K (oh well). ----------------------------------------------------- svn:ignore installer executables Modified Paths: -------------- branches/v2_0_0/Makefile.mingw branches/v2_0_0/config.h.mingw branches/v2_0_0/gaim-installer.nsi branches/v2_0_0/src/Makefile.mingw branches/v2_0_0/src/protocols/jabber/Makefile.mingw Property Changed: ---------------- branches/v2_0_0/ Property changes on: branches/v2_0_0 ___________________________________________________________________ Name: svn:ignore - ABOUT-NLS aclocal.m4 autom4te.cache compile confdefs.h config.cache config.guess config.h config.h.in config.h.in~ config.log config.status config.sub configure configure.2.1x depcomp Doxyfile gaim.apspec gaim.desktop gaim.pc gaim.service gaim.spec install-sh intl intltool-extract intltool-extract.in intltool-merge intltool-merge.in intltool-update intltool-update.in libtool ltconfig ltmain.sh Makefile Makefile.in missing stamp-h stamp-h1 stamp-h.in *.swp .temp-gettextize win32-install-dir + ABOUT-NLS aclocal.m4 autom4te.cache compile confdefs.h config.cache config.guess config.h config.h.in config.h.in~ config.log config.status config.sub configure configure.2.1x depcomp Doxyfile gaim.apspec gaim.desktop gaim.pc gaim.service gaim.spec install-sh intl intltool-extract intltool-extract.in intltool-merge intltool-merge.in intltool-update intltool-update.in libtool ltconfig ltmain.sh Makefile Makefile.in missing stamp-h stamp-h1 stamp-h.in *.swp .temp-gettextize win32-install-dir gaim-*.exe Modified: branches/v2_0_0/Makefile.mingw =================================================================== --- branches/v2_0_0/Makefile.mingw 2006-06-08 15:19:56 UTC (rev 16235) +++ branches/v2_0_0/Makefile.mingw 2006-06-08 15:20:38 UTC (rev 16236) @@ -12,6 +12,7 @@ GAIM_SOUNDS = ./sounds GAIM_INSTALL_DIR = ./win32-install-dir GTKSPELL_TOP = ../win32-dev/gtkspell-2.0.6/gtkspell +LIBXML2_DIR = ../win32-dev/libxml2 IDLETRACK_TOP = $(GAIM_SRC)/win32/IdleTracker GTKRC_TOP = ../win32-dev/gtkrc OSCAR = $(GAIM_PROTOS)/oscar @@ -33,7 +34,8 @@ VERSION := $(shell cat ./VERSION) NEEDED_DLLS = $(GTKSPELL_TOP)/libgtkspell.dll \ - $(IDLETRACK_TOP)/idletrack.dll + $(IDLETRACK_TOP)/idletrack.dll \ + $(LIBXML2_DIR)/bin/libxml2.dll SOUNDS = $(GAIM_SOUNDS)/alert.wav \ $(GAIM_SOUNDS)/login.wav \ Modified: branches/v2_0_0/config.h.mingw =================================================================== --- branches/v2_0_0/config.h.mingw 2006-06-08 15:19:56 UTC (rev 16235) +++ branches/v2_0_0/config.h.mingw 2006-06-08 15:20:38 UTC (rev 16236) @@ -635,6 +635,8 @@ <inttypes.h> don't define. */ /* #undef uintmax_t */ +#define HAVE_LIBXML 1 + /* * Following are added for Win32 version of Gaim */ Modified: branches/v2_0_0/gaim-installer.nsi =================================================================== --- branches/v2_0_0/gaim-installer.nsi 2006-06-08 15:19:56 UTC (rev 16235) +++ branches/v2_0_0/gaim-installer.nsi 2006-06-08 15:20:38 UTC (rev 16236) @@ -744,6 +744,7 @@ Delete "$INSTDIR\idletrack.dll" Delete "$INSTDIR\libgtkspell.dll" Delete "$INSTDIR\libmeanwhile-1.dll" + Delete "$INSTDIR\libxml2.dll" Delete "$INSTDIR\nspr4.dll" Delete "$INSTDIR\nss3.dll" Delete "$INSTDIR\nssckbi.dll" Modified: branches/v2_0_0/src/Makefile.mingw =================================================================== --- branches/v2_0_0/src/Makefile.mingw 2006-06-08 15:19:56 UTC (rev 16235) +++ branches/v2_0_0/src/Makefile.mingw 2006-06-08 15:20:38 UTC (rev 16236) @@ -18,6 +18,7 @@ GAIM_INSTALL_DIR := $(GAIM_TOP)/win32-install-dir NSS_DIR := ../../win32-dev/nss-3.9 NSPR_DIR := ../../win32-dev/nspr-4.4.1 +LIBXML2_DIR := ../../win32-dev/libxml2 ## ## VARIABLE DEFINITIONS @@ -66,7 +67,8 @@ -I$(ASPELL_TOP)/include \ -I$(GTKSPELL_TOP) \ -I$(NSS_DIR)/include \ - -I$(NSPR_DIR)/include + -I$(NSPR_DIR)/include \ + -I$(LIBXML2_DIR)/include LIB_PATHS = -L$(GTK_TOP)/lib \ @@ -74,7 +76,8 @@ -L$(IDLETRACK_TOP) \ -L$(ASPELL_TOP)/lib \ -L$(NSS_DIR)/lib \ - -L$(NSPR_DIR)/lib + -L$(NSPR_DIR)/lib \ + -L$(LIBXML2_DIR)/lib ## ## SOURCES, OBJECTS @@ -191,8 +194,8 @@ -lidletrack \ -lnss3 \ -lnspr4 \ - -lssl3 - + -lssl3 \ + -lxml2 EXE_LIBS = Modified: branches/v2_0_0/src/protocols/jabber/Makefile.mingw =================================================================== --- branches/v2_0_0/src/protocols/jabber/Makefile.mingw 2006-06-08 15:19:56 UTC (rev 16235) +++ branches/v2_0_0/src/protocols/jabber/Makefile.mingw 2006-06-08 15:20:38 UTC (rev 16236) @@ -10,6 +10,7 @@ INCLUDE_DIR := . GTK_TOP := ../../../../win32-dev/gtk_2_0 +LIBXML2_DIR:= ../../../../win32-dev/libxml2 GAIM_TOP := ../../.. JABBER_ROOT := . GAIM_INSTALL_DIR := $(GAIM_TOP)/win32-install-dir @@ -50,18 +51,16 @@ INCLUDE_PATHS += -I$(JABBER_ROOT) \ -I$(JABBER_ROOT)/win32 \ -I$(GTK_TOP)/include \ - -I$(GTK_TOP)/include/gtk-2.0 \ -I$(GTK_TOP)/include/glib-2.0 \ - -I$(GTK_TOP)/include/pango-1.0 \ - -I$(GTK_TOP)/include/atk-1.0 \ -I$(GTK_TOP)/lib/glib-2.0/include \ - -I$(GTK_TOP)/lib/gtk-2.0/include \ + -I$(LIBXML2_DIR)/include \ -I$(GAIM_TOP)/src \ -I$(GAIM_TOP)/src/win32 \ -I$(GAIM_TOP) LIB_PATHS = -L$(GTK_TOP)/lib \ + -L$(LIBXML2_DIR)/lib \ -L$(GAIM_TOP)/src @@ -93,11 +92,9 @@ ## LIBRARIES ## -LIBS = -lgtk-win32-2.0 \ +LIBS = \ -lglib-2.0 \ - -lgdk-win32-2.0 \ - -lgmodule-2.0 \ - -lgobject-2.0 \ + -lxml2 \ -lws2_32 \ -lintl \ -lgaim This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dat...@us...> - 2006-06-08 15:20:09
|
Revision: 16235 Author: datallah Date: 2006-06-08 08:19:56 -0700 (Thu, 08 Jun 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16235&view=rev Log Message: ----------- svn:ignore installer executables Property Changed: ---------------- trunk/ Property changes on: trunk ___________________________________________________________________ Name: svn:ignore - ABOUT-NLS aclocal.m4 autom4te.cache compile confdefs.h config.cache config.guess config.h config.h.in config.h.in~ config.log config.status config.sub configure configure.2.1x depcomp Doxyfile gaim.apspec gaim.desktop gaim.pc gaim.service gaim.spec install-sh intl intltool-extract intltool-extract.in intltool-merge intltool-merge.in intltool-update intltool-update.in libtool ltconfig ltmain.sh Makefile Makefile.in missing stamp-h stamp-h1 stamp-h.in *.swp .temp-gettextize win32-install-dir + ABOUT-NLS aclocal.m4 autom4te.cache compile confdefs.h config.cache config.guess config.h config.h.in config.h.in~ config.log config.status config.sub configure configure.2.1x depcomp Doxyfile gaim.apspec gaim.desktop gaim.pc gaim.service gaim.spec install-sh intl intltool-extract intltool-extract.in intltool-merge intltool-merge.in intltool-update intltool-update.in libtool ltconfig ltmain.sh Makefile Makefile.in missing stamp-h stamp-h1 stamp-h.in *.swp .temp-gettextize win32-install-dir gaim-*.exe This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dat...@us...> - 2006-06-08 15:13:47
|
Revision: 16234 Author: datallah Date: 2006-06-08 08:13:39 -0700 (Thu, 08 Jun 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16234&view=rev Log Message: ----------- Use libxml2 on win32 too. This increases the installer size by ~400K (oh well). Modified Paths: -------------- trunk/Makefile.mingw trunk/config.h.mingw trunk/gaim-installer.nsi trunk/src/Makefile.mingw trunk/src/protocols/jabber/Makefile.mingw Modified: trunk/Makefile.mingw =================================================================== --- trunk/Makefile.mingw 2006-06-08 04:55:11 UTC (rev 16233) +++ trunk/Makefile.mingw 2006-06-08 15:13:39 UTC (rev 16234) @@ -12,6 +12,7 @@ GAIM_SOUNDS = ./sounds GAIM_INSTALL_DIR = ./win32-install-dir GTKSPELL_TOP = ../win32-dev/gtkspell-2.0.6/gtkspell +LIBXML2_DIR = ../win32-dev/libxml2 IDLETRACK_TOP = $(GAIM_SRC)/win32/IdleTracker GTKRC_TOP = ../win32-dev/gtkrc OSCAR = $(GAIM_PROTOS)/oscar @@ -33,7 +34,8 @@ VERSION := $(shell cat ./VERSION) NEEDED_DLLS = $(GTKSPELL_TOP)/libgtkspell.dll \ - $(IDLETRACK_TOP)/idletrack.dll + $(IDLETRACK_TOP)/idletrack.dll \ + $(LIBXML2_DIR)/bin/libxml2.dll SOUNDS = $(GAIM_SOUNDS)/alert.wav \ $(GAIM_SOUNDS)/login.wav \ Modified: trunk/config.h.mingw =================================================================== --- trunk/config.h.mingw 2006-06-08 04:55:11 UTC (rev 16233) +++ trunk/config.h.mingw 2006-06-08 15:13:39 UTC (rev 16234) @@ -635,6 +635,8 @@ <inttypes.h> don't define. */ /* #undef uintmax_t */ +#define HAVE_LIBXML 1 + /* * Following are added for Win32 version of Gaim */ Modified: trunk/gaim-installer.nsi =================================================================== --- trunk/gaim-installer.nsi 2006-06-08 04:55:11 UTC (rev 16233) +++ trunk/gaim-installer.nsi 2006-06-08 15:13:39 UTC (rev 16234) @@ -744,6 +744,7 @@ Delete "$INSTDIR\idletrack.dll" Delete "$INSTDIR\libgtkspell.dll" Delete "$INSTDIR\libmeanwhile-1.dll" + Delete "$INSTDIR\libxml2.dll" Delete "$INSTDIR\nspr4.dll" Delete "$INSTDIR\nss3.dll" Delete "$INSTDIR\nssckbi.dll" Modified: trunk/src/Makefile.mingw =================================================================== --- trunk/src/Makefile.mingw 2006-06-08 04:55:11 UTC (rev 16233) +++ trunk/src/Makefile.mingw 2006-06-08 15:13:39 UTC (rev 16234) @@ -18,6 +18,7 @@ GAIM_INSTALL_DIR := $(GAIM_TOP)/win32-install-dir NSS_DIR := ../../win32-dev/nss-3.9 NSPR_DIR := ../../win32-dev/nspr-4.4.1 +LIBXML2_DIR := ../../win32-dev/libxml2 ## ## VARIABLE DEFINITIONS @@ -66,7 +67,8 @@ -I$(ASPELL_TOP)/include \ -I$(GTKSPELL_TOP) \ -I$(NSS_DIR)/include \ - -I$(NSPR_DIR)/include + -I$(NSPR_DIR)/include \ + -I$(LIBXML2_DIR)/include LIB_PATHS = -L$(GTK_TOP)/lib \ @@ -74,7 +76,8 @@ -L$(IDLETRACK_TOP) \ -L$(ASPELL_TOP)/lib \ -L$(NSS_DIR)/lib \ - -L$(NSPR_DIR)/lib + -L$(NSPR_DIR)/lib \ + -L$(LIBXML2_DIR)/lib ## ## SOURCES, OBJECTS @@ -191,8 +194,8 @@ -lidletrack \ -lnss3 \ -lnspr4 \ - -lssl3 - + -lssl3 \ + -lxml2 EXE_LIBS = Modified: trunk/src/protocols/jabber/Makefile.mingw =================================================================== --- trunk/src/protocols/jabber/Makefile.mingw 2006-06-08 04:55:11 UTC (rev 16233) +++ trunk/src/protocols/jabber/Makefile.mingw 2006-06-08 15:13:39 UTC (rev 16234) @@ -10,6 +10,7 @@ INCLUDE_DIR := . GTK_TOP := ../../../../win32-dev/gtk_2_0 +LIBXML2_DIR:= ../../../../win32-dev/libxml2 GAIM_TOP := ../../.. JABBER_ROOT := . GAIM_INSTALL_DIR := $(GAIM_TOP)/win32-install-dir @@ -50,18 +51,16 @@ INCLUDE_PATHS += -I$(JABBER_ROOT) \ -I$(JABBER_ROOT)/win32 \ -I$(GTK_TOP)/include \ - -I$(GTK_TOP)/include/gtk-2.0 \ -I$(GTK_TOP)/include/glib-2.0 \ - -I$(GTK_TOP)/include/pango-1.0 \ - -I$(GTK_TOP)/include/atk-1.0 \ -I$(GTK_TOP)/lib/glib-2.0/include \ - -I$(GTK_TOP)/lib/gtk-2.0/include \ + -I$(LIBXML2_DIR)/include \ -I$(GAIM_TOP)/src \ -I$(GAIM_TOP)/src/win32 \ -I$(GAIM_TOP) LIB_PATHS = -L$(GTK_TOP)/lib \ + -L$(LIBXML2_DIR)/lib \ -L$(GAIM_TOP)/src @@ -93,11 +92,9 @@ ## LIBRARIES ## -LIBS = -lgtk-win32-2.0 \ +LIBS = \ -lglib-2.0 \ - -lgdk-win32-2.0 \ - -lgmodule-2.0 \ - -lgobject-2.0 \ + -lxml2 \ -lws2_32 \ -lintl \ -lgaim This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ebl...@us...> - 2006-06-08 04:55:21
|
Revision: 16233 Author: eblanton Date: 2006-06-07 21:55:11 -0700 (Wed, 07 Jun 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16233&view=rev Log Message: ----------- Applying the following commit to the v2_0_0 branch: ------------------------------------------------------------------------ r16232 | eblanton | 2006-06-08 00:27:04 -0400 (Thu, 08 Jun 2006) | 6 lines Don Seiler submitted this patch to bug #1426339. It compensates for a jabber server error where some broken servers send more than one group name with a buddy. Or something like that. In any case, the server was broken and Gaim didn't handle it very gracefully, and it's a one-line fix. ------------------------------------------------------------------------ Modified Paths: -------------- branches/v2_0_0/src/protocols/jabber/roster.c Modified: branches/v2_0_0/src/protocols/jabber/roster.c =================================================================== --- branches/v2_0_0/src/protocols/jabber/roster.c 2006-06-08 04:27:04 UTC (rev 16232) +++ branches/v2_0_0/src/protocols/jabber/roster.c 2006-06-08 04:55:11 UTC (rev 16233) @@ -21,6 +21,7 @@ #include "internal.h" #include "debug.h" #include "server.h" +#include "util.h" #include "buddy.h" #include "presence.h" @@ -202,7 +203,9 @@ if(!(group_name = xmlnode_get_data(group))) group_name = g_strdup(""); - groups = g_slist_append(groups, group_name); + + if (g_slist_find_custom(groups, group_name, (GCompareFunc)gaim_utf8_strcasecmp) == NULL) + groups = g_slist_append(groups, group_name); } add_gaim_buddies_in_groups(js, jid, name, groups); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ebl...@us...> - 2006-06-08 04:27:11
|
Revision: 16232 Author: eblanton Date: 2006-06-07 21:27:04 -0700 (Wed, 07 Jun 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16232&view=rev Log Message: ----------- Don Seiler submitted this patch to bug #1426339. It compensates for a jabber server error where some broken servers send more than one group name with a buddy. Or something like that. In any case, the server was broken and Gaim didn't handle it very gracefully, and it's a one-line fix. Modified Paths: -------------- trunk/src/protocols/jabber/roster.c Modified: trunk/src/protocols/jabber/roster.c =================================================================== --- trunk/src/protocols/jabber/roster.c 2006-06-08 03:28:18 UTC (rev 16231) +++ trunk/src/protocols/jabber/roster.c 2006-06-08 04:27:04 UTC (rev 16232) @@ -21,6 +21,7 @@ #include "internal.h" #include "debug.h" #include "server.h" +#include "util.h" #include "buddy.h" #include "presence.h" @@ -202,7 +203,9 @@ if(!(group_name = xmlnode_get_data(group))) group_name = g_strdup(""); - groups = g_slist_append(groups, group_name); + + if (g_slist_find_custom(groups, group_name, (GCompareFunc)gaim_utf8_strcasecmp) == NULL) + groups = g_slist_append(groups, group_name); } add_gaim_buddies_in_groups(js, jid, name, groups); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sea...@us...> - 2006-06-08 03:28:26
|
Revision: 16231 Author: seanegan Date: 2006-06-07 20:28:18 -0700 (Wed, 07 Jun 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16231&view=rev Log Message: ----------- backport of bugfix Modified Paths: -------------- branches/v2_0_0/src/protocols/jabber/jabber.c Modified: branches/v2_0_0/src/protocols/jabber/jabber.c =================================================================== --- branches/v2_0_0/src/protocols/jabber/jabber.c 2006-06-08 01:15:26 UTC (rev 16230) +++ branches/v2_0_0/src/protocols/jabber/jabber.c 2006-06-08 03:28:18 UTC (rev 16231) @@ -1462,21 +1462,21 @@ if(xmlnode_get_child(packet, "aborted")) { js->gc->wants_to_die = TRUE; text = _("Authorization Aborted"); - } else if(xmlnode_get_child(error, "incorrect-encoding")) { + } else if(xmlnode_get_child(packet, "incorrect-encoding")) { text = _("Incorrect encoding in authorization"); - } else if(xmlnode_get_child(error, "invalid-authzid")) { + } else if(xmlnode_get_child(packet, "invalid-authzid")) { js->gc->wants_to_die = TRUE; text = _("Invalid authzid"); - } else if(xmlnode_get_child(error, "invalid-mechanism")) { + } else if(xmlnode_get_child(packet, "invalid-mechanism")) { js->gc->wants_to_die = TRUE; text = _("Invalid Authorization Mechanism"); - } else if(xmlnode_get_child(error, "mechanism-too-weak")) { + } else if(xmlnode_get_child(packet, "mechanism-too-weak")) { js->gc->wants_to_die = TRUE; text = _("Authorization mechanism too weak"); - } else if(xmlnode_get_child(error, "not-authorized")) { + } else if(xmlnode_get_child(packet, "not-authorized")) { js->gc->wants_to_die = TRUE; text = _("Not Authorized"); - } else if(xmlnode_get_child(error, "temporary-auth-failure")) { + } else if(xmlnode_get_child(packet, "temporary-auth-failure")) { text = _("Temporary Authentication Failure"); } else { js->gc->wants_to_die = TRUE; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ebl...@us...> - 2006-06-08 02:33:05
|
Revision: 16228 Author: eblanton Date: 2006-06-07 08:58:27 -0700 (Wed, 07 Jun 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16228&view=rev Log Message: ----------- Emil on IRC points out that gaim_gtk_append_menu_action returns no value. Modified Paths: -------------- trunk/src/gtkutils.h Modified: trunk/src/gtkutils.h =================================================================== --- trunk/src/gtkutils.h 2006-06-07 01:51:23 UTC (rev 16227) +++ trunk/src/gtkutils.h 2006-06-07 15:58:27 UTC (rev 16228) @@ -432,8 +432,6 @@ * @param menu The menu to append to. * @param act The GaimMenuAction to append. * @param gobject The object to be passed to the action callback. - * - * @return The menu. */ void gaim_gtk_append_menu_action(GtkWidget *menu, GaimMenuAction *act, gpointer gobject); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sea...@us...> - 2006-06-08 01:28:19
|
Revision: 16230 Author: seanegan Date: 2006-06-07 18:15:26 -0700 (Wed, 07 Jun 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16230&view=rev Log Message: ----------- backport to 2.0.0 Modified Paths: -------------- branches/v2_0_0/configure.ac branches/v2_0_0/src/Makefile.am branches/v2_0_0/src/gtkdialogs.c branches/v2_0_0/src/protocols/jabber/Makefile.am branches/v2_0_0/src/protocols/jabber/auth.c branches/v2_0_0/src/protocols/jabber/buddy.c branches/v2_0_0/src/protocols/jabber/chat.c branches/v2_0_0/src/protocols/jabber/disco.c branches/v2_0_0/src/protocols/jabber/iq.c branches/v2_0_0/src/protocols/jabber/jabber.c branches/v2_0_0/src/protocols/jabber/jabber.h branches/v2_0_0/src/protocols/jabber/message.c branches/v2_0_0/src/protocols/jabber/oob.c branches/v2_0_0/src/protocols/jabber/parser.c branches/v2_0_0/src/protocols/jabber/presence.c branches/v2_0_0/src/protocols/jabber/si.c branches/v2_0_0/src/protocols/jabber/xdata.c branches/v2_0_0/src/xmlnode.c branches/v2_0_0/src/xmlnode.h Modified: branches/v2_0_0/configure.ac =================================================================== --- branches/v2_0_0/configure.ac 2006-06-08 01:03:51 UTC (rev 16229) +++ branches/v2_0_0/configure.ac 2006-06-08 01:15:26 UTC (rev 16230) @@ -171,6 +171,17 @@ AC_DEFINE(USE_GSTREAMER, 1, [Use GStreamer for making sounds]) fi +dnl ################# +dnl # LibXML2 +dnl ################# +enable_libxml=yes +PKG_CHECK_MODULES(LIBXML, libxml-2.0, ,enable_libxml=no) +AC_SUBST(LIBXML_CFLAGS) +AC_SUBST(LIBXML_LIBS) +if test "x$enable_libxml" = "xyes"; then + AC_DEFINE(HAVE_LIBXML, 1, [Use libxml2 for xml parsing]) +fi + dnl ####################################################################### dnl # Check for Meanwhile headers (for Sametime) dnl ####################################################################### Modified: branches/v2_0_0/src/Makefile.am =================================================================== --- branches/v2_0_0/src/Makefile.am 2006-06-08 01:03:51 UTC (rev 16229) +++ branches/v2_0_0/src/Makefile.am 2006-06-08 01:15:26 UTC (rev 16230) @@ -347,7 +347,8 @@ $(SM_LIBS) \ $(INTLLIBS) \ $(GTKSPELL_LIBS) \ - $(STARTUP_NOTIFICATION_LIBS) + $(STARTUP_NOTIFICATION_LIBS) \ + $(LIBXML_LIBS) AM_CPPFLAGS = \ -DBR_PTHREADS=0 \ @@ -361,4 +362,5 @@ $(GTK_CFLAGS) \ $(DBUS_CFLAGS) \ $(GTKSPELL_CFLAGS) \ - $(STARTUP_NOTIFICATION_CFLAGS) + $(STARTUP_NOTIFICATION_CFLAGS) \ + $(LIBXML_CFLAGS) Modified: branches/v2_0_0/src/gtkdialogs.c =================================================================== --- branches/v2_0_0/src/gtkdialogs.c 2006-06-08 01:03:51 UTC (rev 16229) +++ branches/v2_0_0/src/gtkdialogs.c 2006-06-08 01:15:26 UTC (rev 16230) @@ -438,6 +438,12 @@ #endif #endif +#ifdef HAVE_LIBXML + g_string_append_printf(str, " <b>XML Parser:</b> libxml2<br/>"); +#else + g_string_append_printf(str, " <b>XML Parser:</b> GMarkup<br/>"); +#endif + #ifdef HAVE_LIBGADU #ifdef _WIN32 g_string_append(str, " <b>Gadu-Gadu library (libgadu):</b> Internal<br/>"); Modified: branches/v2_0_0/src/protocols/jabber/Makefile.am =================================================================== --- branches/v2_0_0/src/protocols/jabber/Makefile.am 2006-06-08 01:03:51 UTC (rev 16229) +++ branches/v2_0_0/src/protocols/jabber/Makefile.am 2006-06-08 01:15:26 UTC (rev 16230) @@ -60,4 +60,5 @@ AM_CPPFLAGS = \ -I$(top_srcdir)/src \ $(DEBUG_CFLAGS) \ - $(GLIB_CFLAGS) + $(GLIB_CFLAGS) \ + $(LIBXML_CFLAGS) Modified: branches/v2_0_0/src/protocols/jabber/auth.c =================================================================== --- branches/v2_0_0/src/protocols/jabber/auth.c 2006-06-08 01:03:51 UTC (rev 16229) +++ branches/v2_0_0/src/protocols/jabber/auth.c 2006-06-08 01:15:26 UTC (rev 16230) @@ -67,7 +67,7 @@ gchar *enc_out; auth = xmlnode_new("auth"); - xmlnode_set_attrib(auth, "xmlns", "urn:ietf:params:xml:ns:xmpp-sasl"); + xmlnode_set_namespace(auth, "urn:ietf:params:xml:ns:xmpp-sasl"); response = g_string_new(""); response = g_string_append_len(response, "\0", 1); @@ -269,7 +269,7 @@ if (js->sasl_state == SASL_CONTINUE || js->sasl_state == SASL_OK) { auth = xmlnode_new("auth"); - xmlnode_set_attrib(auth, "xmlns", "urn:ietf:params:xml:ns:xmpp-sasl"); + xmlnode_set_namespace(auth, "urn:ietf:params:xml:ns:xmpp-sasl"); xmlnode_set_attrib(auth,"mechanism", mech); if (clientout) { if (coutlen == 0) { @@ -386,7 +386,7 @@ js->auth_type = JABBER_AUTH_DIGEST_MD5; auth = xmlnode_new("auth"); - xmlnode_set_attrib(auth, "xmlns", "urn:ietf:params:xml:ns:xmpp-sasl"); + xmlnode_set_namespace(auth, "urn:ietf:params:xml:ns:xmpp-sasl"); xmlnode_set_attrib(auth, "mechanism", "DIGEST-MD5"); jabber_send(js, auth); @@ -720,7 +720,7 @@ return; } else { response = xmlnode_new("response"); - xmlnode_set_attrib(response, "xmlns", "urn:ietf:params:xml:ns:xmpp-sasl"); + xmlnode_set_namespace(response, "urn:ietf:params:xml:ns:xmpp-sasl"); if (c_out) { enc_out = gaim_base64_encode((unsigned char*)c_out, clen); xmlnode_insert_data(response, enc_out, -1); @@ -735,7 +735,7 @@ void jabber_auth_handle_success(JabberStream *js, xmlnode *packet) { - const char *ns = xmlnode_get_attrib(packet, "xmlns"); + const char *ns = xmlnode_get_namespace(packet); #ifdef HAVE_CYRUS_SASL int *x; #endif Modified: branches/v2_0_0/src/protocols/jabber/buddy.c =================================================================== --- branches/v2_0_0/src/protocols/jabber/buddy.c 2006-06-08 01:03:51 UTC (rev 16229) +++ branches/v2_0_0/src/protocols/jabber/buddy.c 2006-06-08 01:15:26 UTC (rev 16230) @@ -1108,7 +1108,7 @@ xmlnode_set_attrib(iq->node, "to", jid); vcard = xmlnode_new_child(iq->node, "vCard"); - xmlnode_set_attrib(vcard, "xmlns", "vcard-temp"); + xmlnode_set_namespace(vcard, "vcard-temp"); jabber_iq_set_callback(iq, jabber_vcard_parse, jbi); jbi->ids = g_slist_prepend(jbi->ids, g_strdup(iq->id)); Modified: branches/v2_0_0/src/protocols/jabber/chat.c =================================================================== --- branches/v2_0_0/src/protocols/jabber/chat.c 2006-06-08 01:03:51 UTC (rev 16229) +++ branches/v2_0_0/src/protocols/jabber/chat.c 2006-06-08 01:15:26 UTC (rev 16230) @@ -162,7 +162,7 @@ if(chat->muc) { xmlnode_set_attrib(message, "to", room_jid); x = xmlnode_new_child(message, "x"); - xmlnode_set_attrib(x, "xmlns", "http://jabber.org/protocol/muc#user"); + xmlnode_set_namespace(x, "http://jabber.org/protocol/muc#user"); invite = xmlnode_new_child(x, "invite"); xmlnode_set_attrib(invite, "to", name); body = xmlnode_new_child(invite, "reason"); @@ -173,7 +173,7 @@ xmlnode_insert_data(body, msg, -1); x = xmlnode_new_child(message, "x"); xmlnode_set_attrib(x, "jid", room_jid); - xmlnode_set_attrib(x, "xmlns", "jabber:x:conference"); + xmlnode_set_namespace(x, "jabber:x:conference"); } jabber_send(js, message); @@ -267,7 +267,7 @@ g_free(full_jid); x = xmlnode_new_child(presence, "x"); - xmlnode_set_attrib(x, "xmlns", "http://jabber.org/protocol/muc"); + xmlnode_set_namespace(x, "http://jabber.org/protocol/muc"); if(passwd && *passwd) { xmlnode *password = xmlnode_new_child(x, "password"); @@ -380,7 +380,7 @@ for(x = xmlnode_get_child(query, "x"); x; x = xmlnode_get_next_twin(x)) { const char *xmlns; - if(!(xmlns = xmlnode_get_attrib(x, "xmlns"))) + if(!(xmlns = xmlnode_get_namespace(x))) continue; if(!strcmp(xmlns, "jabber:x:data")) { @@ -451,7 +451,7 @@ room_jid = g_strdup_printf("%s@%s", chat->room, chat->server); xmlnode_set_attrib(iq->node, "to", room_jid); - xmlnode_set_attrib(x, "xmlns", "jabber:x:data"); + xmlnode_set_namespace(x, "jabber:x:data"); xmlnode_set_attrib(x, "type", "submit"); jabber_iq_send(iq); @@ -524,7 +524,7 @@ for(x = xmlnode_get_child(query, "x"); x; x = xmlnode_get_next_twin(x)) { const char *xmlns; - if(!(xmlns = xmlnode_get_attrib(x, "xmlns"))) + if(!(xmlns = xmlnode_get_namespace(x))) continue; if(!strcmp(xmlns, "jabber:x:data")) { Modified: branches/v2_0_0/src/protocols/jabber/disco.c =================================================================== --- branches/v2_0_0/src/protocols/jabber/disco.c 2006-06-08 01:03:51 UTC (rev 16229) +++ branches/v2_0_0/src/protocols/jabber/disco.c 2006-06-08 01:15:26 UTC (rev 16230) @@ -104,7 +104,7 @@ xmlnode_set_attrib(error, "code", "404"); xmlnode_set_attrib(error, "type", "cancel"); inf = xmlnode_new_child(error, "item-not-found"); - xmlnode_set_attrib(inf, "xmlns", "urn:ietf:params:xml:ns:xmpp-stanzas"); + xmlnode_set_namespace(inf, "urn:ietf:params:xml:ns:xmpp-stanzas"); } jabber_iq_send(iq); Modified: branches/v2_0_0/src/protocols/jabber/iq.c =================================================================== --- branches/v2_0_0/src/protocols/jabber/iq.c 2006-06-08 01:03:51 UTC (rev 16229) +++ branches/v2_0_0/src/protocols/jabber/iq.c 2006-06-08 01:15:26 UTC (rev 16230) @@ -78,7 +78,7 @@ xmlnode *query; query = xmlnode_new_child(iq->node, "query"); - xmlnode_set_attrib(query, "xmlns", xmlns); + xmlnode_set_namespace(query, xmlns); return iq; } @@ -268,7 +268,7 @@ /* Apparently not, so lets see if we have a pre-defined handler */ - if(type && query && (xmlns = xmlnode_get_attrib(query, "xmlns"))) { + if(type && query && (xmlns = xmlnode_get_namespace(query))) { if(!strcmp(type, "set")) { if(!strcmp(xmlns, "jabber:iq:roster")) { jabber_roster_parse(js, packet); @@ -329,7 +329,7 @@ xmlnode_set_attrib(error, "type", "cancel"); xmlnode_set_attrib(error, "code", "501"); x = xmlnode_new_child(error, "feature-not-implemented"); - xmlnode_set_attrib(x, "xmlns", "urn:ietf:params:xml:ns:xmpp-stanzas"); + xmlnode_set_namespace(x, "urn:ietf:params:xml:ns:xmpp-stanzas"); jabber_iq_send(iq); } Modified: branches/v2_0_0/src/protocols/jabber/jabber.c =================================================================== --- branches/v2_0_0/src/protocols/jabber/jabber.c 2006-06-08 01:03:51 UTC (rev 16229) +++ branches/v2_0_0/src/protocols/jabber/jabber.c 2006-06-08 01:15:26 UTC (rev 16230) @@ -63,9 +63,9 @@ "xmlns:stream='http://etherx.jabber.org/streams' " "version='1.0'>", js->user->domain); - + /* setup the parser fresh for each stream */ + jabber_parser_setup(js); jabber_send_raw(js, open_stream, -1); - g_free(open_stream); } @@ -88,7 +88,7 @@ jabber_iq_set_callback(iq, jabber_session_initialized_cb, NULL); session = xmlnode_new_child(iq->node, "session"); - xmlnode_set_attrib(session, "xmlns", "urn:ietf:params:xml:ns:xmpp-session"); + xmlnode_set_namespace(session, "urn:ietf:params:xml:ns:xmpp-session"); jabber_iq_send(iq); } @@ -137,7 +137,7 @@ xmlnode *bind, *resource; JabberIq *iq = jabber_iq_new(js, JABBER_IQ_SET); bind = xmlnode_new_child(iq->node, "bind"); - xmlnode_set_attrib(bind, "xmlns", "urn:ietf:params:xml:ns:xmpp-bind"); + xmlnode_set_namespace(bind, "urn:ietf:params:xml:ns:xmpp-bind"); resource = xmlnode_new_child(bind, "resource"); xmlnode_insert_data(resource, js->user->resource, -1); @@ -174,8 +174,14 @@ jabber_message_parse(js, packet); } else if(!strcmp(packet->name, "stream:features")) { jabber_stream_features_parse(js, packet); + } else if (!strcmp(packet->name, "features") && + !strcmp(xmlnode_get_namespace(packet), "http://etherx.jabber.org/streams")) { + jabber_stream_features_parse(js, packet); } else if(!strcmp(packet->name, "stream:error")) { jabber_stream_handle_error(js, packet); + } else if (!strcmp(packet->name, "error") && + !strcmp(xmlnode_get_namespace(packet), "http://etherx.jabber.org/streams")) { + jabber_stream_handle_error(js, packet); } else if(!strcmp(packet->name, "challenge")) { if(js->state == JABBER_STREAM_AUTHENTICATING) jabber_auth_handle_challenge(js, packet); @@ -405,7 +411,6 @@ if(js->state == JABBER_STREAM_CONNECTING) jabber_send_raw(js, "<?xml version='1.0' ?>", -1); - jabber_stream_set_state(js, JABBER_STREAM_INITIALIZING); gaim_ssl_input_add(gsc, jabber_recv_cb_ssl, gc); } @@ -923,9 +928,10 @@ gaim_input_remove(js->gc->inpa); close(js->fd); } - +#ifndef HAVE_LIBXML if(js->context) g_markup_parse_context_free(js->context); +#endif if(js->iq_callbacks) g_hash_table_destroy(js->iq_callbacks); if(js->disco_callbacks) @@ -981,7 +987,6 @@ gaim_connection_update_progress(js->gc, _("Initializing Stream"), js->gsc ? 5 : 2, JABBER_CONNECT_STEPS); jabber_stream_init(js); - jabber_parser_setup(js); break; case JABBER_STREAM_AUTHENTICATING: gaim_connection_update_progress(js->gc, _("Authenticating"), @@ -1400,7 +1405,7 @@ { xmlnode *error; const char *code = NULL, *text = NULL; - const char *xmlns = xmlnode_get_attrib(packet, "xmlns"); + const char *xmlns = xmlnode_get_namespace(packet); char *cdata = NULL; if((error = xmlnode_get_child(packet, "error"))) { Modified: branches/v2_0_0/src/protocols/jabber/jabber.h =================================================================== --- branches/v2_0_0/src/protocols/jabber/jabber.h 2006-06-08 01:03:51 UTC (rev 16229) +++ branches/v2_0_0/src/protocols/jabber/jabber.h 2006-06-08 01:15:26 UTC (rev 16230) @@ -22,6 +22,9 @@ #ifndef _GAIM_JABBER_H_ #define _GAIM_JABBER_H_ +#ifdef HAVE_LIBXML +#include <libxml/parser.h> +#endif #include <glib.h> #include "connection.h" #include "roomlist.h" @@ -64,7 +67,11 @@ { int fd; +#ifdef HAVE_LIBXML + xmlParserCtxt *context; +#else GMarkupParseContext *context; +#endif xmlnode *current; enum { Modified: branches/v2_0_0/src/protocols/jabber/message.c =================================================================== --- branches/v2_0_0/src/protocols/jabber/message.c 2006-06-08 01:03:51 UTC (rev 16229) +++ branches/v2_0_0/src/protocols/jabber/message.c 2006-06-08 01:15:26 UTC (rev 16230) @@ -123,7 +123,7 @@ for(etc = jm->etc; etc; etc = etc->next) { xmlnode *x = etc->data; - const char *xmlns = xmlnode_get_attrib(x, "xmlns"); + const char *xmlns = xmlnode_get_namespace(x); if(xmlns && !strcmp(xmlns, "jabber:x:oob")) { xmlnode *url, *desc; char *urltxt, *desctxt; @@ -325,7 +325,7 @@ g_free(code_txt); g_free(text); } else if(!strcmp(child->name, "x")) { - const char *xmlns = xmlnode_get_attrib(child, "xmlns"); + const char *xmlns = xmlnode_get_namespace(child); if(xmlns && !strcmp(xmlns, "jabber:x:event")) { if(xmlnode_get_child(child, "composing")) { if(jm->chat_state == JM_STATE_ACTIVE) @@ -440,7 +440,7 @@ if(JM_TS_JEP_0022 == (jm->typing_style & JM_TS_JEP_0022)) { child = xmlnode_new_child(message, "x"); - xmlnode_set_attrib(child, "xmlns", "jabber:x:event"); + xmlnode_set_namespace(child, "jabber:x:event"); if(jm->chat_state == JM_STATE_COMPOSING || jm->body) xmlnode_new_child(child, "composing"); } @@ -466,7 +466,7 @@ break; } if(child) - xmlnode_set_attrib(child, "xmlns", "http://jabber.org/protocol/chatstates"); + xmlnode_set_namespace(child, "http://jabber.org/protocol/chatstates"); } if(jm->subject) { Modified: branches/v2_0_0/src/protocols/jabber/oob.c =================================================================== --- branches/v2_0_0/src/protocols/jabber/oob.c 2006-06-08 01:03:51 UTC (rev 16229) +++ branches/v2_0_0/src/protocols/jabber/oob.c 2006-06-08 01:15:26 UTC (rev 16230) @@ -168,11 +168,11 @@ if(!strcmp(code, "406")) { z = xmlnode_new_child(y, "not-acceptable"); xmlnode_set_attrib(y, "type", "modify"); - xmlnode_set_attrib(z, "xmlns", "urn:ietf:params:xml:ns:xmpp-stanzas"); + xmlnode_set_namespace(z, "urn:ietf:params:xml:ns:xmpp-stanzas"); } else if(!strcmp(code, "404")) { z = xmlnode_new_child(y, "not-found"); xmlnode_set_attrib(y, "type", "cancel"); - xmlnode_set_attrib(z, "xmlns", "urn:ietf:params:xml:ns:xmpp-stanzas"); + xmlnode_set_namespace(z, "urn:ietf:params:xml:ns:xmpp-stanzas"); } jabber_iq_send(iq); Modified: branches/v2_0_0/src/protocols/jabber/parser.c =================================================================== --- branches/v2_0_0/src/protocols/jabber/parser.c 2006-06-08 01:03:51 UTC (rev 16229) +++ branches/v2_0_0/src/protocols/jabber/parser.c 2006-06-08 01:15:26 UTC (rev 16230) @@ -20,12 +20,17 @@ */ #include "internal.h" +#ifdef HAVE_LIBXML +#include <libxml/parser.h> +#endif + #include "connection.h" - +#include "debug.h" #include "jabber.h" #include "parser.h" #include "xmlnode.h" +#ifndef HAVE_LIBXML static void jabber_parser_element_start(GMarkupParseContext *context, const char *element_name, const char **attrib_names, @@ -104,6 +109,136 @@ xmlnode_insert_data(js->current, text, text_len); } +#else /* HAVE_LIBXML */ + +static void +jabber_parser_element_start_libxml(void *user_data, + const xmlChar *element_name, const xmlChar *prefix, const xmlChar *namespace, + int nb_namespaces, const xmlChar **namespaces, + int nb_attributes, int nb_defaulted, const xmlChar **attributes) +{ + JabberStream *js = user_data; + xmlnode *node; + int i; + + if(!element_name) { + return; + } else if(!strcmp(element_name, "stream")) { + js->protocol_version = JABBER_PROTO_0_9; + for(i=0; i < nb_attributes * 5; i += 5) { + int attrib_len = attributes[i+4] - attributes[i+3]; + char *attrib = g_malloc(attrib_len + 1); + memcpy(attrib, attributes[i+3], attrib_len); + attrib[attrib_len] = '\0'; + + if(!strcmp(attributes[i], "version") + && !strcmp(attrib, "1.0")) { + js->protocol_version = JABBER_PROTO_1_0; + } else if(!strcmp(attributes[i], "id")) { + if(js->stream_id) + g_free(js->stream_id); + js->stream_id = g_strdup(attrib); + } + g_free(attrib); + } + if(js->protocol_version == JABBER_PROTO_0_9) + js->auth_type = JABBER_AUTH_IQ_AUTH; + + if(js->state == JABBER_STREAM_INITIALIZING) + jabber_stream_set_state(js, JABBER_STREAM_AUTHENTICATING); + } else { + + if(js->current) + node = xmlnode_new_child(js->current, element_name); + else + node = xmlnode_new(element_name); + xmlnode_set_namespace(node, namespace); + + for(i=0; i < nb_attributes * 5; i+=5) { + int attrib_len = attributes[i+4] - attributes[i+3]; + char *attrib = g_malloc(attrib_len + 1); + memcpy(attrib, attributes[i+3], attrib_len); + attrib[attrib_len] = '\0'; + xmlnode_set_attrib(node, attributes[i], attrib); + g_free(attrib); + } + + js->current = node; + } +} + +static void +jabber_parser_element_end_libxml(void *user_data, const xmlChar *element_name, + const xmlChar *prefix, const xmlChar *namespace) +{ + JabberStream *js = user_data; + + if(!js->current) + return; + + if(js->current->parent) { + if(!strcmp(js->current->name, element_name)) + js->current = js->current->parent; + } else { + xmlnode *packet = js->current; + js->current = NULL; + jabber_process_packet(js, packet); + xmlnode_free(packet); + } +} + +static void +jabber_parser_element_text_libxml(void *user_data, const xmlChar *text, int text_len) +{ + JabberStream *js = user_data; + + if(!js->current) + return; + + if(!text || !text_len) + return; + + xmlnode_insert_data(js->current, text, text_len); +} +#endif /* HAVE_LIBXML */ + + +#ifdef HAVE_LIBXML +static xmlSAXHandler jabber_parser_libxml = { + .internalSubset = NULL, + .isStandalone = NULL, + .hasInternalSubset = NULL, + .hasExternalSubset = NULL, + .resolveEntity = NULL, + .getEntity = NULL, + .entityDecl = NULL, + .notationDecl = NULL, + .attributeDecl = NULL, + .elementDecl = NULL, + .unparsedEntityDecl = NULL, + .setDocumentLocator = NULL, + .startDocument = NULL, + .endDocument = NULL, + .startElement = NULL, + .endElement = NULL, + .reference = NULL, + .characters = jabber_parser_element_text_libxml, + .ignorableWhitespace = NULL, + .processingInstruction = NULL, + .comment = NULL, + .warning = NULL, + .error = NULL, + .fatalError = NULL, + .getParameterEntity = NULL, + .cdataBlock = NULL, + .externalSubset = NULL, + .initialized = XML_SAX2_MAGIC, + ._private = NULL, + .startElementNs = jabber_parser_element_start_libxml, + .endElementNs = jabber_parser_element_end_libxml, + .serror = NULL +}; +#else static GMarkupParser jabber_parser = { jabber_parser_element_start, jabber_parser_element_end, @@ -111,24 +246,47 @@ NULL, NULL }; +#endif void jabber_parser_setup(JabberStream *js) { +#ifdef HAVE_LIBXML + /* This seems backwards, but it makes sense. The libxml code creates the parser + * context when you try to use it (this way, it can figure out the encoding at + * creation time. So, setting up the parser is just a matter of destroying any + * current parser. */ + if (js->context) { + xmlParseChunk(js->context, NULL,0,1); + xmlFreeParserCtxt(js->context); + js->context = NULL; + } +#else if(!js->context) js->context = g_markup_parse_context_new(&jabber_parser, 0, js, NULL); +#endif } void jabber_parser_process(JabberStream *js, const char *buf, int len) { +#ifndef HAVE_LIBXML /* May need to check for other encodings and do the conversion here */ - if(!g_markup_parse_context_parse(js->context, buf, len, NULL)) { g_markup_parse_context_free(js->context); js->context = NULL; gaim_connection_error(js->gc, _("XML Parse error")); } +#else + if (js->context == NULL) { + /* libxml inconsistently starts parsing on creating the parser, so so a ParseChunk + * right afterwards to force it. */ + js->context = xmlCreatePushParserCtxt(&jabber_parser_libxml, js, buf, len, NULL); + xmlParseChunk(js->context, NULL, 0, 0); + } else if (xmlParseChunk(js->context, buf, len, 0) < 0) { + gaim_connection_error(js->gc, _("XML Parse error")); + } +#endif } Modified: branches/v2_0_0/src/protocols/jabber/presence.c =================================================================== --- branches/v2_0_0/src/protocols/jabber/presence.c 2006-06-08 01:03:51 UTC (rev 16229) +++ branches/v2_0_0/src/protocols/jabber/presence.c 2006-06-08 01:15:26 UTC (rev 16230) @@ -121,7 +121,7 @@ if(js->avatar_hash) { x = xmlnode_new_child(presence, "x"); - xmlnode_set_attrib(x, "xmlns", "vcard-temp:x:update"); + xmlnode_set_namespace(x, "vcard-temp:x:update"); photo = xmlnode_new_child(x, "photo"); xmlnode_insert_data(photo, js->avatar_hash, -1); } @@ -167,7 +167,7 @@ /* JEP-0115 */ c = xmlnode_new_child(presence, "c"); - xmlnode_set_attrib(c, "xmlns", "http://jabber.org/protocol/caps"); + xmlnode_set_namespace(c, "http://jabber.org/protocol/caps"); xmlnode_set_attrib(c, "node", CAPS0115_NODE); xmlnode_set_attrib(c, "ver", VERSION); @@ -290,7 +290,6 @@ gboolean muc = FALSE; char *avatar_hash = NULL; - if(!(jb = jabber_buddy_find(js, from, TRUE))) return; @@ -363,7 +362,7 @@ g_free(p); } } else if(!strcmp(y->name, "x")) { - const char *xmlns = xmlnode_get_attrib(y, "xmlns"); + const char *xmlns = xmlnode_get_namespace(y); if(xmlns && !strcmp(xmlns, "jabber:x:delay")) { /* XXX: compare the time. jabber:x:delay can happen on presence packets that aren't really and truly delayed */ delayed = TRUE; @@ -464,7 +463,7 @@ for(x = xmlnode_get_child(packet, "x"); x; x = xmlnode_get_next_twin(x)) { const char *xmlns, *nick, *code; xmlnode *stat, *item; - if(!(xmlns = xmlnode_get_attrib(x, "xmlns")) || + if(!(xmlns = xmlnode_get_namespace(x)) || strcmp(xmlns, "http://jabber.org/protocol/muc#user")) continue; if(!(stat = xmlnode_get_child(x, "status"))) @@ -560,7 +559,7 @@ iq = jabber_iq_new(js, JABBER_IQ_GET); xmlnode_set_attrib(iq->node, "to", buddy_name); vcard = xmlnode_new_child(iq->node, "vCard"); - xmlnode_set_attrib(vcard, "xmlns", "vcard-temp"); + xmlnode_set_namespace(vcard, "vcard-temp"); jabber_iq_set_callback(iq, jabber_vcard_parse_avatar, NULL); jabber_iq_send(iq); Modified: branches/v2_0_0/src/protocols/jabber/si.c =================================================================== --- branches/v2_0_0/src/protocols/jabber/si.c 2006-06-08 01:03:51 UTC (rev 16229) +++ branches/v2_0_0/src/protocols/jabber/si.c 2006-06-08 01:15:26 UTC (rev 16230) @@ -139,7 +139,7 @@ xmlnode_set_attrib(error, "code", "404"); xmlnode_set_attrib(error, "type", "cancel"); condition = xmlnode_new_child(error, "condition"); - xmlnode_set_attrib(condition, "xmlns", "urn:ietf:params:xml:ns:xmpp-stanzas"); + xmlnode_set_namespace(condition, "urn:ietf:params:xml:ns:xmpp-stanzas"); xmlnode_new_child(condition, "item-not-found"); jabber_iq_send(iq); @@ -637,14 +637,14 @@ iq = jabber_iq_new(jsx->js, JABBER_IQ_SET); xmlnode_set_attrib(iq->node, "to", xfer->who); si = xmlnode_new_child(iq->node, "si"); - xmlnode_set_attrib(si, "xmlns", "http://jabber.org/protocol/si"); + xmlnode_set_namespace(si, "http://jabber.org/protocol/si"); jsx->stream_id = jabber_get_next_id(jsx->js); xmlnode_set_attrib(si, "id", jsx->stream_id); xmlnode_set_attrib(si, "profile", "http://jabber.org/protocol/si/profile/file-transfer"); file = xmlnode_new_child(si, "file"); - xmlnode_set_attrib(file, "xmlns", + xmlnode_set_namespace(file, "http://jabber.org/protocol/si/profile/file-transfer"); xmlnode_set_attrib(file, "name", xfer->filename); g_snprintf(buf, sizeof(buf), "%" G_GSIZE_FORMAT, xfer->size); @@ -652,10 +652,10 @@ /* maybe later we'll do hash and date attribs */ feature = xmlnode_new_child(si, "feature"); - xmlnode_set_attrib(feature, "xmlns", + xmlnode_set_namespace(feature, "http://jabber.org/protocol/feature-neg"); x = xmlnode_new_child(feature, "x"); - xmlnode_set_attrib(x, "xmlns", "jabber:x:data"); + xmlnode_set_namespace(x, "jabber:x:data"); xmlnode_set_attrib(x, "type", "form"); field = xmlnode_new_child(x, "field"); xmlnode_set_attrib(field, "var", "stream-method"); @@ -771,13 +771,13 @@ jsx->accepted = TRUE; si = xmlnode_new_child(iq->node, "si"); - xmlnode_set_attrib(si, "xmlns", "http://jabber.org/protocol/si"); + xmlnode_set_namespace(si, "http://jabber.org/protocol/si"); feature = xmlnode_new_child(si, "feature"); - xmlnode_set_attrib(feature, "xmlns", "http://jabber.org/protocol/feature-neg"); + xmlnode_set_namespace(feature, "http://jabber.org/protocol/feature-neg"); x = xmlnode_new_child(feature, "x"); - xmlnode_set_attrib(x, "xmlns", "jabber:x:data"); + xmlnode_set_namespace(x, "jabber:x:data"); xmlnode_set_attrib(x, "type", "submit"); field = xmlnode_new_child(x, "field"); Modified: branches/v2_0_0/src/protocols/jabber/xdata.c =================================================================== --- branches/v2_0_0/src/protocols/jabber/xdata.c 2006-06-08 01:03:51 UTC (rev 16229) +++ branches/v2_0_0/src/protocols/jabber/xdata.c 2006-06-08 01:15:26 UTC (rev 16230) @@ -49,7 +49,7 @@ JabberStream *js = data->js; GList *groups, *flds; - xmlnode_set_attrib(result, "xmlns", "jabber:x:data"); + xmlnode_set_namespace(result, "jabber:x:data"); xmlnode_set_attrib(result, "type", "submit"); for(groups = gaim_request_fields_get_groups(fields); groups; groups = groups->next) { @@ -140,7 +140,7 @@ } g_free(data); - xmlnode_set_attrib(result, "xmlns", "jabber:x:data"); + xmlnode_set_namespace(result, "jabber:x:data"); xmlnode_set_attrib(result, "type", "cancel"); cb(js, result, user_data); Modified: branches/v2_0_0/src/xmlnode.c =================================================================== --- branches/v2_0_0/src/xmlnode.c 2006-06-08 01:03:51 UTC (rev 16229) +++ branches/v2_0_0/src/xmlnode.c 2006-06-08 01:15:26 UTC (rev 16230) @@ -29,6 +29,9 @@ #include "internal.h" +#ifdef HAVE_LIBXML +#include <libxml/parser.h> +#endif #include <string.h> #include <glib.h> @@ -172,6 +175,32 @@ return NULL; } + +void xmlnode_set_namespace(xmlnode *node, const char *xmlns) +{ +#ifdef HAVE_LIBXML + g_return_if_fail(node != NULL); + + if (node->namespace) + g_free(node->namespace); + + node->namespace = g_strdup(xmlns); +#else + return xmlnode_set_attrib(node, "xmlns", xmlns); +#endif +} + +const char *xmlnode_get_namespace(xmlnode *node) +{ +#ifdef HAVE_LIBXML + g_return_val_if_fail(node != NULL, NULL); + + return node->namespace; +#else + return xmlnode_get_attrib(node, "xmlns"); +#endif +} + void xmlnode_free(xmlnode *node) { @@ -190,6 +219,10 @@ g_free(node->name); if(node->data) g_free(node->data); +#ifdef HAVE_LIBXML + if(node->namespace) + g_free(node->namespace); +#endif g_free(node); } @@ -216,7 +249,7 @@ for(x = parent->child; x; x = x->next) { const char *xmlns = NULL; if(ns) - xmlns = xmlnode_get_attrib(x, "xmlns"); + xmlns = xmlnode_get_namespace(x); if(x->type == XMLNODE_TYPE_TAG && name && !strcmp(parent_name, x->name) && (!ns || (xmlns && !strcmp(ns, xmlns)))) { @@ -272,6 +305,13 @@ node_name = g_markup_escape_text(node->name, -1); g_string_append_printf(text, "<%s", node_name); +#ifdef HAVE_LIBXML + if (node->namespace) { + char *namespace = g_markup_escape_text(node->namespace, -1); + g_string_append_printf(text, " xmlns='%s'", namespace); + g_free(namespace); + } +#endif for(c = node->child; c; c = c->next) { if(c->type == XMLNODE_TYPE_ATTRIB) { @@ -347,7 +387,72 @@ xmlnode *current; }; +#ifdef HAVE_LIBXML static void +xmlnode_parser_element_start_libxml(void *user_data, + const xmlChar *element_name, const xmlChar *prefix, const xmlChar *namespace, + int nb_namespaces, const xmlChar **namespaces, + int nb_attributes, int nb_defaulted, const xmlChar **attributes) +{ + struct _xmlnode_parser_data *xpd = user_data; + xmlnode *node; + int i; + + if(!element_name) { + return; + } else { + if(xpd->current) + node = xmlnode_new_child(xpd->current, element_name); + else + node = xmlnode_new(element_name); + + xmlnode_set_namespace(node, namespace); + + for(i=0; i < nb_attributes * 5; i+=5) { + int attrib_len = attributes[i+4] - attributes[i+3]; + char *attrib = g_malloc(attrib_len + 1); + memcpy(attrib, attributes[i+3], attrib_len); + attrib[attrib_len] = '\0'; + xmlnode_set_attrib(node, attributes[i], attrib); + g_free(attrib); + } + + xpd->current = node; + } +} + +static void +xmlnode_parser_element_end_libxml(void *user_data, const xmlChar *element_name, + const xmlChar *prefix, const xmlChar *namespace) +{ + struct _xmlnode_parser_data *xpd = user_data; + + if(!element_name || !xpd->current) + return; + + if(xpd->current->parent) { + if(!strcmp(xpd->current->name, element_name)) + xpd->current = xpd->current->parent; + } +} + +static void +xmlnode_parser_element_text_libxml(void *user_data, const xmlChar *text, int text_len) +{ + struct _xmlnode_parser_data *xpd = user_data; + + if(!xpd->current) + return; + + if(!text || !text_len) + return; + + xmlnode_insert_data(xpd->current, text, text_len); +} + +#else + +static void xmlnode_parser_element_start(GMarkupParseContext *context, const char *element_name, const char **attrib_names, const char **attrib_values, gpointer user_data, GError **error) @@ -400,7 +505,44 @@ xmlnode_insert_data(xpd->current, text, text_len); } +#endif +#ifdef HAVE_LIBXML +static xmlSAXHandler xmlnode_parser_libxml = { + .internalSubset = NULL, + .isStandalone = NULL, + .hasInternalSubset = NULL, + .hasExternalSubset = NULL, + .resolveEntity = NULL, + .getEntity = NULL, + .entityDecl = NULL, + .notationDecl = NULL, + .attributeDecl = NULL, + .elementDecl = NULL, + .unparsedEntityDecl = NULL, + .setDocumentLocator = NULL, + .startDocument = NULL, + .endDocument = NULL, + .startElement = NULL, + .endElement = NULL, + .reference = NULL, + .characters = xmlnode_parser_element_text_libxml, + .ignorableWhitespace = NULL, + .processingInstruction = NULL, + .comment = NULL, + .warning = NULL, + .error = NULL, + .fatalError = NULL, + .getParameterEntity = NULL, + .cdataBlock = NULL, + .externalSubset = NULL, + .initialized = XML_SAX2_MAGIC, + ._private = NULL, + .startElementNs = xmlnode_parser_element_start_libxml, + .endElementNs = xmlnode_parser_element_end_libxml, + .serror = NULL +}; +#else static GMarkupParser xmlnode_parser = { xmlnode_parser_element_start, xmlnode_parser_element_end, @@ -408,8 +550,8 @@ NULL, NULL }; +#endif - xmlnode * xmlnode_from_str(const char *str, gssize size) { @@ -422,6 +564,16 @@ real_size = size < 0 ? strlen(str) : size; xpd = g_new0(struct _xmlnode_parser_data, 1); + +#ifdef HAVE_LIBXML + if (xmlSAXUserParseMemory(&xmlnode_parser_libxml, xpd, str, size) < 0) { + while(xpd->current && xpd->current->parent) + xpd->current = xpd->current->parent; + if(xpd->current) + xmlnode_free(xpd->current); + xpd->current = NULL; + } +#else context = g_markup_parse_context_new(&xmlnode_parser, 0, xpd, NULL); if(!g_markup_parse_context_parse(context, str, real_size, NULL)) { @@ -432,7 +584,7 @@ xpd->current = NULL; } g_markup_parse_context_free(context); - +#endif ret = xpd->current; g_free(xpd); return ret; @@ -477,7 +629,7 @@ xmlnode_get_next_twin(xmlnode *node) { xmlnode *sibling; - const char *ns = xmlnode_get_attrib(node, "xmlns"); + const char *ns = xmlnode_get_namespace(node); g_return_val_if_fail(node != NULL, NULL); g_return_val_if_fail(node->type == XMLNODE_TYPE_TAG, NULL); @@ -485,7 +637,7 @@ for(sibling = node->next; sibling; sibling = sibling->next) { const char *xmlns = NULL; if(ns) - xmlns = xmlnode_get_attrib(sibling, "xmlns"); + xmlns = xmlnode_get_namespace(sibling); if(sibling->type == XMLNODE_TYPE_TAG && !strcmp(node->name, sibling->name) && (!ns || (xmlns && !strcmp(ns, xmlns)))) Modified: branches/v2_0_0/src/xmlnode.h =================================================================== --- branches/v2_0_0/src/xmlnode.h 2006-06-08 01:03:51 UTC (rev 16229) +++ branches/v2_0_0/src/xmlnode.h 2006-06-08 01:15:26 UTC (rev 16230) @@ -41,6 +41,9 @@ typedef struct _xmlnode { char *name; /**< The name of the node. */ +#ifdef HAVE_LIBXML + char *namespace; /**< The namespace of the node */ +#endif XMLNodeType type; /**< The type of the node. */ char *data; /**< The data for the node. */ size_t data_sz; /**< The size of the data. */ @@ -154,6 +157,22 @@ void xmlnode_remove_attrib(xmlnode *node, const char *attr); /** + * Sets the namespace of a node + * + * @param node The node to qualify + * @param xmlns The namespace of the node + */ +void xmlnode_set_namespace(xmlnode *node, const char *xmlns); + +/** + * Returns the namespace of a node + * + * @param node The node to get the namepsace from + * @return The namespace of this node + */ +const char *xmlnode_get_namespace(xmlnode *node); + +/** * Returns the node in a string of xml. * * @param node The starting node to output. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sea...@us...> - 2006-06-08 01:28:18
|
Revision: 16229 Author: seanegan Date: 2006-06-07 18:03:51 -0700 (Wed, 07 Jun 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16229&view=rev Log Message: ----------- Use libxml2 for XML parsing, if available. The biggest benefit from this is actual support for XML namespaces. This fixes a handful of Google Talk integration problems, including typing notifications and buddy icons. Modified Paths: -------------- trunk/configure.ac trunk/src/Makefile.am trunk/src/gtkdialogs.c trunk/src/protocols/jabber/Makefile.am trunk/src/protocols/jabber/auth.c trunk/src/protocols/jabber/buddy.c trunk/src/protocols/jabber/chat.c trunk/src/protocols/jabber/disco.c trunk/src/protocols/jabber/iq.c trunk/src/protocols/jabber/jabber.c trunk/src/protocols/jabber/jabber.h trunk/src/protocols/jabber/message.c trunk/src/protocols/jabber/oob.c trunk/src/protocols/jabber/parser.c trunk/src/protocols/jabber/presence.c trunk/src/protocols/jabber/si.c trunk/src/protocols/jabber/xdata.c trunk/src/xmlnode.c trunk/src/xmlnode.h Modified: trunk/configure.ac =================================================================== --- trunk/configure.ac 2006-06-07 15:58:27 UTC (rev 16228) +++ trunk/configure.ac 2006-06-08 01:03:51 UTC (rev 16229) @@ -171,6 +171,17 @@ AC_DEFINE(USE_GSTREAMER, 1, [Use GStreamer for making sounds]) fi +dnl ################# +dnl # LibXML2 +dnl ################# +enable_libxml=yes +PKG_CHECK_MODULES(LIBXML, libxml-2.0, ,enable_libxml=no) +AC_SUBST(LIBXML_CFLAGS) +AC_SUBST(LIBXML_LIBS) +if test "x$enable_libxml" = "xyes"; then + AC_DEFINE(HAVE_LIBXML, 1, [Use libxml2 for xml parsing]) +fi + dnl ####################################################################### dnl # Check for Meanwhile headers (for Sametime) dnl ####################################################################### Modified: trunk/src/Makefile.am =================================================================== --- trunk/src/Makefile.am 2006-06-07 15:58:27 UTC (rev 16228) +++ trunk/src/Makefile.am 2006-06-08 01:03:51 UTC (rev 16229) @@ -347,7 +347,8 @@ $(SM_LIBS) \ $(INTLLIBS) \ $(GTKSPELL_LIBS) \ - $(STARTUP_NOTIFICATION_LIBS) + $(STARTUP_NOTIFICATION_LIBS) \ + $(LIBXML_LIBS) AM_CPPFLAGS = \ -DBR_PTHREADS=0 \ @@ -361,4 +362,5 @@ $(GTK_CFLAGS) \ $(DBUS_CFLAGS) \ $(GTKSPELL_CFLAGS) \ - $(STARTUP_NOTIFICATION_CFLAGS) + $(STARTUP_NOTIFICATION_CFLAGS) \ + $(LIBXML_CFLAGS) Modified: trunk/src/gtkdialogs.c =================================================================== --- trunk/src/gtkdialogs.c 2006-06-07 15:58:27 UTC (rev 16228) +++ trunk/src/gtkdialogs.c 2006-06-08 01:03:51 UTC (rev 16229) @@ -438,6 +438,12 @@ #endif #endif +#ifdef HAVE_LIBXML + g_string_append_printf(str, " <b>XML Parser:</b> libxml2<br/>"); +#else + g_string_append_printf(str, " <b>XML Parser:</b> GMarkup<br/>"); +#endif + #ifdef HAVE_LIBGADU #ifdef _WIN32 g_string_append(str, " <b>Gadu-Gadu library (libgadu):</b> Internal<br/>"); Modified: trunk/src/protocols/jabber/Makefile.am =================================================================== --- trunk/src/protocols/jabber/Makefile.am 2006-06-07 15:58:27 UTC (rev 16228) +++ trunk/src/protocols/jabber/Makefile.am 2006-06-08 01:03:51 UTC (rev 16229) @@ -60,4 +60,5 @@ AM_CPPFLAGS = \ -I$(top_srcdir)/src \ $(DEBUG_CFLAGS) \ - $(GLIB_CFLAGS) + $(GLIB_CFLAGS) \ + $(LIBXML_CFLAGS) Modified: trunk/src/protocols/jabber/auth.c =================================================================== --- trunk/src/protocols/jabber/auth.c 2006-06-07 15:58:27 UTC (rev 16228) +++ trunk/src/protocols/jabber/auth.c 2006-06-08 01:03:51 UTC (rev 16229) @@ -67,7 +67,7 @@ gchar *enc_out; auth = xmlnode_new("auth"); - xmlnode_set_attrib(auth, "xmlns", "urn:ietf:params:xml:ns:xmpp-sasl"); + xmlnode_set_namespace(auth, "urn:ietf:params:xml:ns:xmpp-sasl"); response = g_string_new(""); response = g_string_append_len(response, "\0", 1); @@ -269,7 +269,7 @@ if (js->sasl_state == SASL_CONTINUE || js->sasl_state == SASL_OK) { auth = xmlnode_new("auth"); - xmlnode_set_attrib(auth, "xmlns", "urn:ietf:params:xml:ns:xmpp-sasl"); + xmlnode_set_namespace(auth, "urn:ietf:params:xml:ns:xmpp-sasl"); xmlnode_set_attrib(auth,"mechanism", mech); if (clientout) { if (coutlen == 0) { @@ -386,7 +386,7 @@ js->auth_type = JABBER_AUTH_DIGEST_MD5; auth = xmlnode_new("auth"); - xmlnode_set_attrib(auth, "xmlns", "urn:ietf:params:xml:ns:xmpp-sasl"); + xmlnode_set_namespace(auth, "urn:ietf:params:xml:ns:xmpp-sasl"); xmlnode_set_attrib(auth, "mechanism", "DIGEST-MD5"); jabber_send(js, auth); @@ -720,7 +720,7 @@ return; } else { response = xmlnode_new("response"); - xmlnode_set_attrib(response, "xmlns", "urn:ietf:params:xml:ns:xmpp-sasl"); + xmlnode_set_namespace(response, "urn:ietf:params:xml:ns:xmpp-sasl"); if (c_out) { enc_out = gaim_base64_encode((unsigned char*)c_out, clen); xmlnode_insert_data(response, enc_out, -1); @@ -735,7 +735,7 @@ void jabber_auth_handle_success(JabberStream *js, xmlnode *packet) { - const char *ns = xmlnode_get_attrib(packet, "xmlns"); + const char *ns = xmlnode_get_namespace(packet); #ifdef HAVE_CYRUS_SASL int *x; #endif Modified: trunk/src/protocols/jabber/buddy.c =================================================================== --- trunk/src/protocols/jabber/buddy.c 2006-06-07 15:58:27 UTC (rev 16228) +++ trunk/src/protocols/jabber/buddy.c 2006-06-08 01:03:51 UTC (rev 16229) @@ -1108,7 +1108,7 @@ xmlnode_set_attrib(iq->node, "to", jid); vcard = xmlnode_new_child(iq->node, "vCard"); - xmlnode_set_attrib(vcard, "xmlns", "vcard-temp"); + xmlnode_set_namespace(vcard, "vcard-temp"); jabber_iq_set_callback(iq, jabber_vcard_parse, jbi); jbi->ids = g_slist_prepend(jbi->ids, g_strdup(iq->id)); Modified: trunk/src/protocols/jabber/chat.c =================================================================== --- trunk/src/protocols/jabber/chat.c 2006-06-07 15:58:27 UTC (rev 16228) +++ trunk/src/protocols/jabber/chat.c 2006-06-08 01:03:51 UTC (rev 16229) @@ -162,7 +162,7 @@ if(chat->muc) { xmlnode_set_attrib(message, "to", room_jid); x = xmlnode_new_child(message, "x"); - xmlnode_set_attrib(x, "xmlns", "http://jabber.org/protocol/muc#user"); + xmlnode_set_namespace(x, "http://jabber.org/protocol/muc#user"); invite = xmlnode_new_child(x, "invite"); xmlnode_set_attrib(invite, "to", name); body = xmlnode_new_child(invite, "reason"); @@ -173,7 +173,7 @@ xmlnode_insert_data(body, msg, -1); x = xmlnode_new_child(message, "x"); xmlnode_set_attrib(x, "jid", room_jid); - xmlnode_set_attrib(x, "xmlns", "jabber:x:conference"); + xmlnode_set_namespace(x, "jabber:x:conference"); } jabber_send(js, message); @@ -267,7 +267,7 @@ g_free(full_jid); x = xmlnode_new_child(presence, "x"); - xmlnode_set_attrib(x, "xmlns", "http://jabber.org/protocol/muc"); + xmlnode_set_namespace(x, "http://jabber.org/protocol/muc"); if(passwd && *passwd) { xmlnode *password = xmlnode_new_child(x, "password"); @@ -380,7 +380,7 @@ for(x = xmlnode_get_child(query, "x"); x; x = xmlnode_get_next_twin(x)) { const char *xmlns; - if(!(xmlns = xmlnode_get_attrib(x, "xmlns"))) + if(!(xmlns = xmlnode_get_namespace(x))) continue; if(!strcmp(xmlns, "jabber:x:data")) { @@ -451,7 +451,7 @@ room_jid = g_strdup_printf("%s@%s", chat->room, chat->server); xmlnode_set_attrib(iq->node, "to", room_jid); - xmlnode_set_attrib(x, "xmlns", "jabber:x:data"); + xmlnode_set_namespace(x, "jabber:x:data"); xmlnode_set_attrib(x, "type", "submit"); jabber_iq_send(iq); @@ -524,7 +524,7 @@ for(x = xmlnode_get_child(query, "x"); x; x = xmlnode_get_next_twin(x)) { const char *xmlns; - if(!(xmlns = xmlnode_get_attrib(x, "xmlns"))) + if(!(xmlns = xmlnode_get_namespace(x))) continue; if(!strcmp(xmlns, "jabber:x:data")) { Modified: trunk/src/protocols/jabber/disco.c =================================================================== --- trunk/src/protocols/jabber/disco.c 2006-06-07 15:58:27 UTC (rev 16228) +++ trunk/src/protocols/jabber/disco.c 2006-06-08 01:03:51 UTC (rev 16229) @@ -104,7 +104,7 @@ xmlnode_set_attrib(error, "code", "404"); xmlnode_set_attrib(error, "type", "cancel"); inf = xmlnode_new_child(error, "item-not-found"); - xmlnode_set_attrib(inf, "xmlns", "urn:ietf:params:xml:ns:xmpp-stanzas"); + xmlnode_set_namespace(inf, "urn:ietf:params:xml:ns:xmpp-stanzas"); } jabber_iq_send(iq); Modified: trunk/src/protocols/jabber/iq.c =================================================================== --- trunk/src/protocols/jabber/iq.c 2006-06-07 15:58:27 UTC (rev 16228) +++ trunk/src/protocols/jabber/iq.c 2006-06-08 01:03:51 UTC (rev 16229) @@ -78,7 +78,7 @@ xmlnode *query; query = xmlnode_new_child(iq->node, "query"); - xmlnode_set_attrib(query, "xmlns", xmlns); + xmlnode_set_namespace(query, xmlns); return iq; } @@ -268,7 +268,7 @@ /* Apparently not, so lets see if we have a pre-defined handler */ - if(type && query && (xmlns = xmlnode_get_attrib(query, "xmlns"))) { + if(type && query && (xmlns = xmlnode_get_namespace(query))) { if(!strcmp(type, "set")) { if(!strcmp(xmlns, "jabber:iq:roster")) { jabber_roster_parse(js, packet); @@ -329,7 +329,7 @@ xmlnode_set_attrib(error, "type", "cancel"); xmlnode_set_attrib(error, "code", "501"); x = xmlnode_new_child(error, "feature-not-implemented"); - xmlnode_set_attrib(x, "xmlns", "urn:ietf:params:xml:ns:xmpp-stanzas"); + xmlnode_set_namespace(x, "urn:ietf:params:xml:ns:xmpp-stanzas"); jabber_iq_send(iq); } Modified: trunk/src/protocols/jabber/jabber.c =================================================================== --- trunk/src/protocols/jabber/jabber.c 2006-06-07 15:58:27 UTC (rev 16228) +++ trunk/src/protocols/jabber/jabber.c 2006-06-08 01:03:51 UTC (rev 16229) @@ -63,9 +63,9 @@ "xmlns:stream='http://etherx.jabber.org/streams' " "version='1.0'>", js->user->domain); - + /* setup the parser fresh for each stream */ + jabber_parser_setup(js); jabber_send_raw(js, open_stream, -1); - g_free(open_stream); } @@ -88,7 +88,7 @@ jabber_iq_set_callback(iq, jabber_session_initialized_cb, NULL); session = xmlnode_new_child(iq->node, "session"); - xmlnode_set_attrib(session, "xmlns", "urn:ietf:params:xml:ns:xmpp-session"); + xmlnode_set_namespace(session, "urn:ietf:params:xml:ns:xmpp-session"); jabber_iq_send(iq); } @@ -137,7 +137,7 @@ xmlnode *bind, *resource; JabberIq *iq = jabber_iq_new(js, JABBER_IQ_SET); bind = xmlnode_new_child(iq->node, "bind"); - xmlnode_set_attrib(bind, "xmlns", "urn:ietf:params:xml:ns:xmpp-bind"); + xmlnode_set_namespace(bind, "urn:ietf:params:xml:ns:xmpp-bind"); resource = xmlnode_new_child(bind, "resource"); xmlnode_insert_data(resource, js->user->resource, -1); @@ -174,8 +174,14 @@ jabber_message_parse(js, packet); } else if(!strcmp(packet->name, "stream:features")) { jabber_stream_features_parse(js, packet); + } else if (!strcmp(packet->name, "features") && + !strcmp(xmlnode_get_namespace(packet), "http://etherx.jabber.org/streams")) { + jabber_stream_features_parse(js, packet); } else if(!strcmp(packet->name, "stream:error")) { jabber_stream_handle_error(js, packet); + } else if (!strcmp(packet->name, "error") && + !strcmp(xmlnode_get_namespace(packet), "http://etherx.jabber.org/streams")) { + jabber_stream_handle_error(js, packet); } else if(!strcmp(packet->name, "challenge")) { if(js->state == JABBER_STREAM_AUTHENTICATING) jabber_auth_handle_challenge(js, packet); @@ -405,7 +411,6 @@ if(js->state == JABBER_STREAM_CONNECTING) jabber_send_raw(js, "<?xml version='1.0' ?>", -1); - jabber_stream_set_state(js, JABBER_STREAM_INITIALIZING); gaim_ssl_input_add(gsc, jabber_recv_cb_ssl, gc); } @@ -923,9 +928,10 @@ gaim_input_remove(js->gc->inpa); close(js->fd); } - +#ifndef HAVE_LIBXML if(js->context) g_markup_parse_context_free(js->context); +#endif if(js->iq_callbacks) g_hash_table_destroy(js->iq_callbacks); if(js->disco_callbacks) @@ -981,7 +987,6 @@ gaim_connection_update_progress(js->gc, _("Initializing Stream"), js->gsc ? 5 : 2, JABBER_CONNECT_STEPS); jabber_stream_init(js); - jabber_parser_setup(js); break; case JABBER_STREAM_AUTHENTICATING: gaim_connection_update_progress(js->gc, _("Authenticating"), @@ -1400,7 +1405,7 @@ { xmlnode *error; const char *code = NULL, *text = NULL; - const char *xmlns = xmlnode_get_attrib(packet, "xmlns"); + const char *xmlns = xmlnode_get_namespace(packet); char *cdata = NULL; if((error = xmlnode_get_child(packet, "error"))) { Modified: trunk/src/protocols/jabber/jabber.h =================================================================== --- trunk/src/protocols/jabber/jabber.h 2006-06-07 15:58:27 UTC (rev 16228) +++ trunk/src/protocols/jabber/jabber.h 2006-06-08 01:03:51 UTC (rev 16229) @@ -22,6 +22,9 @@ #ifndef _GAIM_JABBER_H_ #define _GAIM_JABBER_H_ +#ifdef HAVE_LIBXML +#include <libxml/parser.h> +#endif #include <glib.h> #include "connection.h" #include "roomlist.h" @@ -64,7 +67,11 @@ { int fd; +#ifdef HAVE_LIBXML + xmlParserCtxt *context; +#else GMarkupParseContext *context; +#endif xmlnode *current; enum { Modified: trunk/src/protocols/jabber/message.c =================================================================== --- trunk/src/protocols/jabber/message.c 2006-06-07 15:58:27 UTC (rev 16228) +++ trunk/src/protocols/jabber/message.c 2006-06-08 01:03:51 UTC (rev 16229) @@ -123,7 +123,7 @@ for(etc = jm->etc; etc; etc = etc->next) { xmlnode *x = etc->data; - const char *xmlns = xmlnode_get_attrib(x, "xmlns"); + const char *xmlns = xmlnode_get_namespace(x); if(xmlns && !strcmp(xmlns, "jabber:x:oob")) { xmlnode *url, *desc; char *urltxt, *desctxt; @@ -325,7 +325,7 @@ g_free(code_txt); g_free(text); } else if(!strcmp(child->name, "x")) { - const char *xmlns = xmlnode_get_attrib(child, "xmlns"); + const char *xmlns = xmlnode_get_namespace(child); if(xmlns && !strcmp(xmlns, "jabber:x:event")) { if(xmlnode_get_child(child, "composing")) { if(jm->chat_state == JM_STATE_ACTIVE) @@ -440,7 +440,7 @@ if(JM_TS_JEP_0022 == (jm->typing_style & JM_TS_JEP_0022)) { child = xmlnode_new_child(message, "x"); - xmlnode_set_attrib(child, "xmlns", "jabber:x:event"); + xmlnode_set_namespace(child, "jabber:x:event"); if(jm->chat_state == JM_STATE_COMPOSING || jm->body) xmlnode_new_child(child, "composing"); } @@ -466,7 +466,7 @@ break; } if(child) - xmlnode_set_attrib(child, "xmlns", "http://jabber.org/protocol/chatstates"); + xmlnode_set_namespace(child, "http://jabber.org/protocol/chatstates"); } if(jm->subject) { Modified: trunk/src/protocols/jabber/oob.c =================================================================== --- trunk/src/protocols/jabber/oob.c 2006-06-07 15:58:27 UTC (rev 16228) +++ trunk/src/protocols/jabber/oob.c 2006-06-08 01:03:51 UTC (rev 16229) @@ -168,11 +168,11 @@ if(!strcmp(code, "406")) { z = xmlnode_new_child(y, "not-acceptable"); xmlnode_set_attrib(y, "type", "modify"); - xmlnode_set_attrib(z, "xmlns", "urn:ietf:params:xml:ns:xmpp-stanzas"); + xmlnode_set_namespace(z, "urn:ietf:params:xml:ns:xmpp-stanzas"); } else if(!strcmp(code, "404")) { z = xmlnode_new_child(y, "not-found"); xmlnode_set_attrib(y, "type", "cancel"); - xmlnode_set_attrib(z, "xmlns", "urn:ietf:params:xml:ns:xmpp-stanzas"); + xmlnode_set_namespace(z, "urn:ietf:params:xml:ns:xmpp-stanzas"); } jabber_iq_send(iq); Modified: trunk/src/protocols/jabber/parser.c =================================================================== --- trunk/src/protocols/jabber/parser.c 2006-06-07 15:58:27 UTC (rev 16228) +++ trunk/src/protocols/jabber/parser.c 2006-06-08 01:03:51 UTC (rev 16229) @@ -20,12 +20,17 @@ */ #include "internal.h" +#ifdef HAVE_LIBXML +#include <libxml/parser.h> +#endif + #include "connection.h" - +#include "debug.h" #include "jabber.h" #include "parser.h" #include "xmlnode.h" +#ifndef HAVE_LIBXML static void jabber_parser_element_start(GMarkupParseContext *context, const char *element_name, const char **attrib_names, @@ -104,6 +109,136 @@ xmlnode_insert_data(js->current, text, text_len); } +#else /* HAVE_LIBXML */ + +static void +jabber_parser_element_start_libxml(void *user_data, + const xmlChar *element_name, const xmlChar *prefix, const xmlChar *namespace, + int nb_namespaces, const xmlChar **namespaces, + int nb_attributes, int nb_defaulted, const xmlChar **attributes) +{ + JabberStream *js = user_data; + xmlnode *node; + int i; + + if(!element_name) { + return; + } else if(!strcmp(element_name, "stream")) { + js->protocol_version = JABBER_PROTO_0_9; + for(i=0; i < nb_attributes * 5; i += 5) { + int attrib_len = attributes[i+4] - attributes[i+3]; + char *attrib = g_malloc(attrib_len + 1); + memcpy(attrib, attributes[i+3], attrib_len); + attrib[attrib_len] = '\0'; + + if(!strcmp(attributes[i], "version") + && !strcmp(attrib, "1.0")) { + js->protocol_version = JABBER_PROTO_1_0; + } else if(!strcmp(attributes[i], "id")) { + if(js->stream_id) + g_free(js->stream_id); + js->stream_id = g_strdup(attrib); + } + g_free(attrib); + } + if(js->protocol_version == JABBER_PROTO_0_9) + js->auth_type = JABBER_AUTH_IQ_AUTH; + + if(js->state == JABBER_STREAM_INITIALIZING) + jabber_stream_set_state(js, JABBER_STREAM_AUTHENTICATING); + } else { + + if(js->current) + node = xmlnode_new_child(js->current, element_name); + else + node = xmlnode_new(element_name); + xmlnode_set_namespace(node, namespace); + + for(i=0; i < nb_attributes * 5; i+=5) { + int attrib_len = attributes[i+4] - attributes[i+3]; + char *attrib = g_malloc(attrib_len + 1); + memcpy(attrib, attributes[i+3], attrib_len); + attrib[attrib_len] = '\0'; + xmlnode_set_attrib(node, attributes[i], attrib); + g_free(attrib); + } + + js->current = node; + } +} + +static void +jabber_parser_element_end_libxml(void *user_data, const xmlChar *element_name, + const xmlChar *prefix, const xmlChar *namespace) +{ + JabberStream *js = user_data; + + if(!js->current) + return; + + if(js->current->parent) { + if(!strcmp(js->current->name, element_name)) + js->current = js->current->parent; + } else { + xmlnode *packet = js->current; + js->current = NULL; + jabber_process_packet(js, packet); + xmlnode_free(packet); + } +} + +static void +jabber_parser_element_text_libxml(void *user_data, const xmlChar *text, int text_len) +{ + JabberStream *js = user_data; + + if(!js->current) + return; + + if(!text || !text_len) + return; + + xmlnode_insert_data(js->current, text, text_len); +} +#endif /* HAVE_LIBXML */ + + +#ifdef HAVE_LIBXML +static xmlSAXHandler jabber_parser_libxml = { + .internalSubset = NULL, + .isStandalone = NULL, + .hasInternalSubset = NULL, + .hasExternalSubset = NULL, + .resolveEntity = NULL, + .getEntity = NULL, + .entityDecl = NULL, + .notationDecl = NULL, + .attributeDecl = NULL, + .elementDecl = NULL, + .unparsedEntityDecl = NULL, + .setDocumentLocator = NULL, + .startDocument = NULL, + .endDocument = NULL, + .startElement = NULL, + .endElement = NULL, + .reference = NULL, + .characters = jabber_parser_element_text_libxml, + .ignorableWhitespace = NULL, + .processingInstruction = NULL, + .comment = NULL, + .warning = NULL, + .error = NULL, + .fatalError = NULL, + .getParameterEntity = NULL, + .cdataBlock = NULL, + .externalSubset = NULL, + .initialized = XML_SAX2_MAGIC, + ._private = NULL, + .startElementNs = jabber_parser_element_start_libxml, + .endElementNs = jabber_parser_element_end_libxml, + .serror = NULL +}; +#else static GMarkupParser jabber_parser = { jabber_parser_element_start, jabber_parser_element_end, @@ -111,24 +246,47 @@ NULL, NULL }; +#endif void jabber_parser_setup(JabberStream *js) { +#ifdef HAVE_LIBXML + /* This seems backwards, but it makes sense. The libxml code creates the parser + * context when you try to use it (this way, it can figure out the encoding at + * creation time. So, setting up the parser is just a matter of destroying any + * current parser. */ + if (js->context) { + xmlParseChunk(js->context, NULL,0,1); + xmlFreeParserCtxt(js->context); + js->context = NULL; + } +#else if(!js->context) js->context = g_markup_parse_context_new(&jabber_parser, 0, js, NULL); +#endif } void jabber_parser_process(JabberStream *js, const char *buf, int len) { +#ifndef HAVE_LIBXML /* May need to check for other encodings and do the conversion here */ - if(!g_markup_parse_context_parse(js->context, buf, len, NULL)) { g_markup_parse_context_free(js->context); js->context = NULL; gaim_connection_error(js->gc, _("XML Parse error")); } +#else + if (js->context == NULL) { + /* libxml inconsistently starts parsing on creating the parser, so so a ParseChunk + * right afterwards to force it. */ + js->context = xmlCreatePushParserCtxt(&jabber_parser_libxml, js, buf, len, NULL); + xmlParseChunk(js->context, NULL, 0, 0); + } else if (xmlParseChunk(js->context, buf, len, 0) < 0) { + gaim_connection_error(js->gc, _("XML Parse error")); + } +#endif } Modified: trunk/src/protocols/jabber/presence.c =================================================================== --- trunk/src/protocols/jabber/presence.c 2006-06-07 15:58:27 UTC (rev 16228) +++ trunk/src/protocols/jabber/presence.c 2006-06-08 01:03:51 UTC (rev 16229) @@ -121,7 +121,7 @@ if(js->avatar_hash) { x = xmlnode_new_child(presence, "x"); - xmlnode_set_attrib(x, "xmlns", "vcard-temp:x:update"); + xmlnode_set_namespace(x, "vcard-temp:x:update"); photo = xmlnode_new_child(x, "photo"); xmlnode_insert_data(photo, js->avatar_hash, -1); } @@ -167,7 +167,7 @@ /* JEP-0115 */ c = xmlnode_new_child(presence, "c"); - xmlnode_set_attrib(c, "xmlns", "http://jabber.org/protocol/caps"); + xmlnode_set_namespace(c, "http://jabber.org/protocol/caps"); xmlnode_set_attrib(c, "node", CAPS0115_NODE); xmlnode_set_attrib(c, "ver", VERSION); @@ -290,7 +290,6 @@ gboolean muc = FALSE; char *avatar_hash = NULL; - if(!(jb = jabber_buddy_find(js, from, TRUE))) return; @@ -363,7 +362,7 @@ g_free(p); } } else if(!strcmp(y->name, "x")) { - const char *xmlns = xmlnode_get_attrib(y, "xmlns"); + const char *xmlns = xmlnode_get_namespace(y); if(xmlns && !strcmp(xmlns, "jabber:x:delay")) { /* XXX: compare the time. jabber:x:delay can happen on presence packets that aren't really and truly delayed */ delayed = TRUE; @@ -464,7 +463,7 @@ for(x = xmlnode_get_child(packet, "x"); x; x = xmlnode_get_next_twin(x)) { const char *xmlns, *nick, *code; xmlnode *stat, *item; - if(!(xmlns = xmlnode_get_attrib(x, "xmlns")) || + if(!(xmlns = xmlnode_get_namespace(x)) || strcmp(xmlns, "http://jabber.org/protocol/muc#user")) continue; if(!(stat = xmlnode_get_child(x, "status"))) @@ -560,7 +559,7 @@ iq = jabber_iq_new(js, JABBER_IQ_GET); xmlnode_set_attrib(iq->node, "to", buddy_name); vcard = xmlnode_new_child(iq->node, "vCard"); - xmlnode_set_attrib(vcard, "xmlns", "vcard-temp"); + xmlnode_set_namespace(vcard, "vcard-temp"); jabber_iq_set_callback(iq, jabber_vcard_parse_avatar, NULL); jabber_iq_send(iq); Modified: trunk/src/protocols/jabber/si.c =================================================================== --- trunk/src/protocols/jabber/si.c 2006-06-07 15:58:27 UTC (rev 16228) +++ trunk/src/protocols/jabber/si.c 2006-06-08 01:03:51 UTC (rev 16229) @@ -139,7 +139,7 @@ xmlnode_set_attrib(error, "code", "404"); xmlnode_set_attrib(error, "type", "cancel"); condition = xmlnode_new_child(error, "condition"); - xmlnode_set_attrib(condition, "xmlns", "urn:ietf:params:xml:ns:xmpp-stanzas"); + xmlnode_set_namespace(condition, "urn:ietf:params:xml:ns:xmpp-stanzas"); xmlnode_new_child(condition, "item-not-found"); jabber_iq_send(iq); @@ -637,14 +637,14 @@ iq = jabber_iq_new(jsx->js, JABBER_IQ_SET); xmlnode_set_attrib(iq->node, "to", xfer->who); si = xmlnode_new_child(iq->node, "si"); - xmlnode_set_attrib(si, "xmlns", "http://jabber.org/protocol/si"); + xmlnode_set_namespace(si, "http://jabber.org/protocol/si"); jsx->stream_id = jabber_get_next_id(jsx->js); xmlnode_set_attrib(si, "id", jsx->stream_id); xmlnode_set_attrib(si, "profile", "http://jabber.org/protocol/si/profile/file-transfer"); file = xmlnode_new_child(si, "file"); - xmlnode_set_attrib(file, "xmlns", + xmlnode_set_namespace(file, "http://jabber.org/protocol/si/profile/file-transfer"); xmlnode_set_attrib(file, "name", xfer->filename); g_snprintf(buf, sizeof(buf), "%" G_GSIZE_FORMAT, xfer->size); @@ -652,10 +652,10 @@ /* maybe later we'll do hash and date attribs */ feature = xmlnode_new_child(si, "feature"); - xmlnode_set_attrib(feature, "xmlns", + xmlnode_set_namespace(feature, "http://jabber.org/protocol/feature-neg"); x = xmlnode_new_child(feature, "x"); - xmlnode_set_attrib(x, "xmlns", "jabber:x:data"); + xmlnode_set_namespace(x, "jabber:x:data"); xmlnode_set_attrib(x, "type", "form"); field = xmlnode_new_child(x, "field"); xmlnode_set_attrib(field, "var", "stream-method"); @@ -771,13 +771,13 @@ jsx->accepted = TRUE; si = xmlnode_new_child(iq->node, "si"); - xmlnode_set_attrib(si, "xmlns", "http://jabber.org/protocol/si"); + xmlnode_set_namespace(si, "http://jabber.org/protocol/si"); feature = xmlnode_new_child(si, "feature"); - xmlnode_set_attrib(feature, "xmlns", "http://jabber.org/protocol/feature-neg"); + xmlnode_set_namespace(feature, "http://jabber.org/protocol/feature-neg"); x = xmlnode_new_child(feature, "x"); - xmlnode_set_attrib(x, "xmlns", "jabber:x:data"); + xmlnode_set_namespace(x, "jabber:x:data"); xmlnode_set_attrib(x, "type", "submit"); field = xmlnode_new_child(x, "field"); Modified: trunk/src/protocols/jabber/xdata.c =================================================================== --- trunk/src/protocols/jabber/xdata.c 2006-06-07 15:58:27 UTC (rev 16228) +++ trunk/src/protocols/jabber/xdata.c 2006-06-08 01:03:51 UTC (rev 16229) @@ -49,7 +49,7 @@ JabberStream *js = data->js; GList *groups, *flds; - xmlnode_set_attrib(result, "xmlns", "jabber:x:data"); + xmlnode_set_namespace(result, "jabber:x:data"); xmlnode_set_attrib(result, "type", "submit"); for(groups = gaim_request_fields_get_groups(fields); groups; groups = groups->next) { @@ -140,7 +140,7 @@ } g_free(data); - xmlnode_set_attrib(result, "xmlns", "jabber:x:data"); + xmlnode_set_namespace(result, "jabber:x:data"); xmlnode_set_attrib(result, "type", "cancel"); cb(js, result, user_data); Modified: trunk/src/xmlnode.c =================================================================== --- trunk/src/xmlnode.c 2006-06-07 15:58:27 UTC (rev 16228) +++ trunk/src/xmlnode.c 2006-06-08 01:03:51 UTC (rev 16229) @@ -29,6 +29,9 @@ #include "internal.h" +#ifdef HAVE_LIBXML +#include <libxml/parser.h> +#endif #include <string.h> #include <glib.h> @@ -172,6 +175,32 @@ return NULL; } + +void xmlnode_set_namespace(xmlnode *node, const char *xmlns) +{ +#ifdef HAVE_LIBXML + g_return_if_fail(node != NULL); + + if (node->namespace) + g_free(node->namespace); + + node->namespace = g_strdup(xmlns); +#else + return xmlnode_set_attrib(node, "xmlns", xmlns); +#endif +} + +const char *xmlnode_get_namespace(xmlnode *node) +{ +#ifdef HAVE_LIBXML + g_return_val_if_fail(node != NULL, NULL); + + return node->namespace; +#else + return xmlnode_get_attrib(node, "xmlns"); +#endif +} + void xmlnode_free(xmlnode *node) { @@ -190,6 +219,10 @@ g_free(node->name); if(node->data) g_free(node->data); +#ifdef HAVE_LIBXML + if(node->namespace) + g_free(node->namespace); +#endif g_free(node); } @@ -216,7 +249,7 @@ for(x = parent->child; x; x = x->next) { const char *xmlns = NULL; if(ns) - xmlns = xmlnode_get_attrib(x, "xmlns"); + xmlns = xmlnode_get_namespace(x); if(x->type == XMLNODE_TYPE_TAG && name && !strcmp(parent_name, x->name) && (!ns || (xmlns && !strcmp(ns, xmlns)))) { @@ -272,6 +305,13 @@ node_name = g_markup_escape_text(node->name, -1); g_string_append_printf(text, "<%s", node_name); +#ifdef HAVE_LIBXML + if (node->namespace) { + char *namespace = g_markup_escape_text(node->namespace, -1); + g_string_append_printf(text, " xmlns='%s'", namespace); + g_free(namespace); + } +#endif for(c = node->child; c; c = c->next) { if(c->type == XMLNODE_TYPE_ATTRIB) { @@ -347,7 +387,72 @@ xmlnode *current; }; +#ifdef HAVE_LIBXML static void +xmlnode_parser_element_start_libxml(void *user_data, + const xmlChar *element_name, const xmlChar *prefix, const xmlChar *namespace, + int nb_namespaces, const xmlChar **namespaces, + int nb_attributes, int nb_defaulted, const xmlChar **attributes) +{ + struct _xmlnode_parser_data *xpd = user_data; + xmlnode *node; + int i; + + if(!element_name) { + return; + } else { + if(xpd->current) + node = xmlnode_new_child(xpd->current, element_name); + else + node = xmlnode_new(element_name); + + xmlnode_set_namespace(node, namespace); + + for(i=0; i < nb_attributes * 5; i+=5) { + int attrib_len = attributes[i+4] - attributes[i+3]; + char *attrib = g_malloc(attrib_len + 1); + memcpy(attrib, attributes[i+3], attrib_len); + attrib[attrib_len] = '\0'; + xmlnode_set_attrib(node, attributes[i], attrib); + g_free(attrib); + } + + xpd->current = node; + } +} + +static void +xmlnode_parser_element_end_libxml(void *user_data, const xmlChar *element_name, + const xmlChar *prefix, const xmlChar *namespace) +{ + struct _xmlnode_parser_data *xpd = user_data; + + if(!element_name || !xpd->current) + return; + + if(xpd->current->parent) { + if(!strcmp(xpd->current->name, element_name)) + xpd->current = xpd->current->parent; + } +} + +static void +xmlnode_parser_element_text_libxml(void *user_data, const xmlChar *text, int text_len) +{ + struct _xmlnode_parser_data *xpd = user_data; + + if(!xpd->current) + return; + + if(!text || !text_len) + return; + + xmlnode_insert_data(xpd->current, text, text_len); +} + +#else + +static void xmlnode_parser_element_start(GMarkupParseContext *context, const char *element_name, const char **attrib_names, const char **attrib_values, gpointer user_data, GError **error) @@ -400,7 +505,44 @@ xmlnode_insert_data(xpd->current, text, text_len); } +#endif +#ifdef HAVE_LIBXML +static xmlSAXHandler xmlnode_parser_libxml = { + .internalSubset = NULL, + .isStandalone = NULL, + .hasInternalSubset = NULL, + .hasExternalSubset = NULL, + .resolveEntity = NULL, + .getEntity = NULL, + .entityDecl = NULL, + .notationDecl = NULL, + .attributeDecl = NULL, + .elementDecl = NULL, + .unparsedEntityDecl = NULL, + .setDocumentLocator = NULL, + .startDocument = NULL, + .endDocument = NULL, + .startElement = NULL, + .endElement = NULL, + .reference = NULL, + .characters = xmlnode_parser_element_text_libxml, + .ignorableWhitespace = NULL, + .processingInstruction = NULL, + .comment = NULL, + .warning = NULL, + .error = NULL, + .fatalError = NULL, + .getParameterEntity = NULL, + .cdataBlock = NULL, + .externalSubset = NULL, + .initialized = XML_SAX2_MAGIC, + ._private = NULL, + .startElementNs = xmlnode_parser_element_start_libxml, + .endElementNs = xmlnode_parser_element_end_libxml, + .serror = NULL +}; +#else static GMarkupParser xmlnode_parser = { xmlnode_parser_element_start, xmlnode_parser_element_end, @@ -408,8 +550,8 @@ NULL, NULL }; +#endif - xmlnode * xmlnode_from_str(const char *str, gssize size) { @@ -422,6 +564,16 @@ real_size = size < 0 ? strlen(str) : size; xpd = g_new0(struct _xmlnode_parser_data, 1); + +#ifdef HAVE_LIBXML + if (xmlSAXUserParseMemory(&xmlnode_parser_libxml, xpd, str, size) < 0) { + while(xpd->current && xpd->current->parent) + xpd->current = xpd->current->parent; + if(xpd->current) + xmlnode_free(xpd->current); + xpd->current = NULL; + } +#else context = g_markup_parse_context_new(&xmlnode_parser, 0, xpd, NULL); if(!g_markup_parse_context_parse(context, str, real_size, NULL)) { @@ -432,7 +584,7 @@ xpd->current = NULL; } g_markup_parse_context_free(context); - +#endif ret = xpd->current; g_free(xpd); return ret; @@ -477,7 +629,7 @@ xmlnode_get_next_twin(xmlnode *node) { xmlnode *sibling; - const char *ns = xmlnode_get_attrib(node, "xmlns"); + const char *ns = xmlnode_get_namespace(node); g_return_val_if_fail(node != NULL, NULL); g_return_val_if_fail(node->type == XMLNODE_TYPE_TAG, NULL); @@ -485,7 +637,7 @@ for(sibling = node->next; sibling; sibling = sibling->next) { const char *xmlns = NULL; if(ns) - xmlns = xmlnode_get_attrib(sibling, "xmlns"); + xmlns = xmlnode_get_namespace(sibling); if(sibling->type == XMLNODE_TYPE_TAG && !strcmp(node->name, sibling->name) && (!ns || (xmlns && !strcmp(ns, xmlns)))) Modified: trunk/src/xmlnode.h =================================================================== --- trunk/src/xmlnode.h 2006-06-07 15:58:27 UTC (rev 16228) +++ trunk/src/xmlnode.h 2006-06-08 01:03:51 UTC (rev 16229) @@ -41,6 +41,9 @@ typedef struct _xmlnode { char *name; /**< The name of the node. */ +#ifdef HAVE_LIBXML + char *namespace; /**< The namespace of the node */ +#endif XMLNodeType type; /**< The type of the node. */ char *data; /**< The data for the node. */ size_t data_sz; /**< The size of the data. */ @@ -154,6 +157,22 @@ void xmlnode_remove_attrib(xmlnode *node, const char *attr); /** + * Sets the namespace of a node + * + * @param node The node to qualify + * @param xmlns The namespace of the node + */ +void xmlnode_set_namespace(xmlnode *node, const char *xmlns); + +/** + * Returns the namespace of a node + * + * @param node The node to get the namepsace from + * @return The namespace of this node + */ +const char *xmlnode_get_namespace(xmlnode *node); + +/** * Returns the node in a string of xml. * * @param node The starting node to output. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ro...@us...> - 2006-06-07 01:51:34
|
Revision: 16227 Author: roast Date: 2006-06-06 18:51:23 -0700 (Tue, 06 Jun 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16227&view=rev Log Message: ----------- xmllogformat v0.3.1-0x support. 1<x<3 somewhere. Modified Paths: -------------- branches/soc-2006-file-loggers/src/log.c branches/soc-2006-file-loggers/src/util.c Modified: branches/soc-2006-file-loggers/src/log.c =================================================================== --- branches/soc-2006-file-loggers/src/log.c 2006-06-06 17:42:02 UTC (rev 16226) +++ branches/soc-2006-file-loggers/src/log.c 2006-06-07 01:51:23 UTC (rev 16227) @@ -34,6 +34,7 @@ static GSList *loggers = NULL; +static GaimLogLogger *xml_logger; static GaimLogLogger *html_logger; static GaimLogLogger *txt_logger; static GaimLogLogger *old_logger; @@ -46,6 +47,14 @@ static void log_get_log_sets_common(GHashTable *sets); +static gsize xml_logger_write(GaimLog *log, GaimMessageFlags type, + const char *from, time_t time, const char *message); +static void xml_logger_finalize(GaimLog *log); +static GList *xml_logger_list(GaimLogType type, const char *sn, GaimAccount *account); +static GList *xml_logger_list_syslog(GaimAccount *account); +//static char *xml_logger_read(GaimLog *log, GaimLogReadFlags *flags); +static int xml_logger_total_size(GaimLogType type, const char *name, GaimAccount *account); + static gsize html_logger_write(GaimLog *log, GaimMessageFlags type, const char *from, time_t time, const char *message); static void html_logger_finalize(GaimLog *log); @@ -558,6 +567,17 @@ gaim_prefs_add_string("/core/logging/format", "txt"); + xml_logger = gaim_log_logger_new("xml", _("Unified Log Format (XML)"), 8, + NULL, + xml_logger_write, + xml_logger_finalize, + xml_logger_list, + txt_logger_read, + gaim_log_common_sizer, + xml_logger_total_size, + xml_logger_list_syslog); + gaim_log_logger_add(xml_logger); + html_logger = gaim_log_logger_new("html", _("HTML"), 8, NULL, html_logger_write, @@ -645,7 +665,7 @@ /* This log is new */ char *dir; struct tm *tm; - const char *tz; + char *tz; const char *date; char *filename; char *path; @@ -656,13 +676,18 @@ gaim_build_dir (dir, S_IRUSR | S_IWUSR | S_IXUSR); + // roast: tz must be strdup'd. gaim_escape_filename returns a pointer to static data, + // and I need it for escaping remote_user's name for the filename below tm = localtime(&log->time); - tz = gaim_escape_filename(gaim_utf8_strftime("%Z", tm)); - date = gaim_utf8_strftime("%Y-%m-%d.%H%M%S%z", tm); + tz = g_strdup(gaim_escape_filename(gaim_utf8_strftime("%Z", tm))); + date = gaim_utf8_strftime("%Y-%m-%dT%H%M%S%z", tm); - filename = g_strdup_printf("%s%s%s", date, tz, ext ? ext : ""); + filename = g_strdup_printf("%s_%s%s%s", + gaim_escape_filename(gaim_normalize(log->account, log->name)), + date, tz, ext ? ext : ""); path = g_build_filename(dir, filename, NULL); + g_free(tz); g_free(dir); g_free(filename); @@ -926,116 +951,125 @@ g_dir_close(log_dir); } -#if 0 /* Maybe some other time. */ /**************** ** XML LOGGER ** ****************/ +/* static const char *str_from_msg_type (GaimMessageFlags type) { + return ""; - return ""; - } +*/ -static void xml_logger_write(GaimLog *log, +static gsize xml_logger_write(GaimLog *log, GaimMessageFlags type, const char *from, time_t time, const char *message) { - char *xhtml = NULL; + char *msg_fixed; + const char *date = gaim_utf8_strftime("%F %T%z", localtime(&log->time)); + GaimPlugin *plugin = gaim_find_prpl(gaim_account_get_protocol_id(log->account)); + GaimLogCommonLoggerData *data = log->logger_data; + gsize written = 0; + GaimLogType original_type = log->type; + + /* This log is new. We could use the loggers 'new' function, but + * creating a new file there would result in empty files in the case + * that you open a convo with someone, but don't say anything. + */ if (!log->logger_data) { - /* This log is new. We could use the loggers 'new' function, but - * creating a new file there would result in empty files in the case - * that you open a convo with someone, but don't say anything. - */ - struct tm *tm; - const char *tz; - const char *date; - char *dir = gaim_log_get_log_dir(log->type, log->name, log->account); - char *name; - char *filename; + const char *prpl = GAIM_PLUGIN_PROTOCOL_INFO(plugin)->list_icon(log->account, NULL); + gaim_log_common_writer(log, ".chatlog"); - if (dir == NULL) - return; + data = log->logger_data; - tm = localtime(&log->time); - tz = gaim_escape_filename(gaim_utf8_strftime("%Z", tm); - date = gaim_utf8_strftime("%Y-%m-%d.%H%M%S%z", tm); + // if file doesn't exist, die + if (!data->file) return 0; + + fprintf(data->file, "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n"); + + if (log->type == GAIM_LOG_SYSTEM) + written += fprintf(data->file, "<chat service=\"%s\" account=\"%s\" version=\"0.3.1-04\" gaim:logtype=\"system\">\n", + prpl, gaim_account_get_username(log->account)); + else + written += fprintf(data->file, "<chat service=\"%s\" account=\"%s\" version=\"0.3.1-04\">\n", + prpl, gaim_account_get_username(log->account)); + written += fprintf(data->file, "\t<event time=\"%s\" type=\"logStart\" \/>\n", date); + } - name = g_strdup_printf("%s%s%s", date, tz, ext ? ext : ""); + /* if we can't write to the file, give up before we hurt ourselves */ + if(!data->file) + return 0; - gaim_build_dir (dir, S_IRUSR | S_IWUSR | S_IXUSR); + gaim_markup_html_to_xhtml(message, &msg_fixed, NULL); - filename = g_build_filename(dir, name, NULL); - g_free(dir); - g_free(name); - - log->logger_data = g_fopen(filename, "a"); - if (!log->logger_data) { - gaim_debug(GAIM_DEBUG_ERROR, "log", "Could not create log file %s\n", filename); - g_free(filename); - return; - } - g_free(filename); - fprintf(log->logger_data, "<?xml version='1.0' encoding='UTF-8' ?>\n" - "<?xml-stylesheet href='file:///usr/src/web/htdocs/log-stylesheet.xsl' type='text/xml' ?>\n"); - - date = gaim_utf8_strftime("%Y-%m-%d %H:%M:%S", localtime(&log->time)); - fprintf(log->logger_data, "<conversation time='%s' screenname='%s' protocol='%s'>\n", - date, log->name, prpl); + if (log->type == GAIM_LOG_SYSTEM) { + written += fprintf(data->file, "\t<event time=\"%s\" sender=\"%s\" gaim:type=\"system\">%s</event>\n", date, from, msg_fixed); } + else if (type & GAIM_MESSAGE_SYSTEM) { + written += fprintf(data->file, "\t<message time=\"%s\" sender=\"%s\" gaim:type=\"system\">%s</message>\n", date, from, msg_fixed); + } + else if (type & GAIM_MESSAGE_ERROR) { + written += fprintf(data->file, "\t<message time=\"%s\" sender=\"%s\" gaim:type=\"error\">%s</message>\n", date, from, msg_fixed); + } + else if (type & GAIM_MESSAGE_WHISPER) { + written += fprintf(data->file, "\t<message time=\"%s\" sender=\"%s\" gaim:type=\"whisper\">%s</message>\n", date, from, msg_fixed); + } + else if (type & GAIM_MESSAGE_AUTO_RESP && (type & GAIM_MESSAGE_SEND || type & GAIM_MESSAGE_RECV)) { + written += fprintf(data->file, "\t<message time=\"%s\" sender=\"%s\" auto=\"true\">%s</message>\n", date, from, msg_fixed); + } + else if (type & GAIM_MESSAGE_SEND || type & GAIM_MESSAGE_RECV) { + written += fprintf(data->file, "\t<message time=\"%s\" sender=\"%s\">%s</message>\n", date, from, msg_fixed); + } + else { + gaim_debug_error("log", "Unhandled message type."); + written += fprintf(data->file, "\t<message time=\"%s\" sender=\"%s\">%s</message>\n", date, from, msg_fixed); + } - /* if we can't write to the file, give up before we hurt ourselves */ - if(!data->file) - return; + // TODO: haven't written end of file and seeked back - date = log_get_timestamp(log, time); + g_free(msg_fixed); + fflush(data->file); - gaim_markup_html_to_xhtml(message, &xhtml, NULL); - if (from) - fprintf(log->logger_data, "<message %s %s from='%s' time='%s'>%s</message>\n", - str_from_msg_type(type), - type & GAIM_MESSAGE_SEND ? "direction='sent'" : - type & GAIM_MESSAGE_RECV ? "direction='received'" : "", - from, date, xhtml); - else - fprintf(log->logger_data, "<message %s %s time='%s'>%s</message>\n", - str_from_msg_type(type), - type & GAIM_MESSAGE_SEND ? "direction='sent'" : - type & GAIM_MESSAGE_RECV ? "direction='received'" : "", - date, xhtml): - fflush(log->logger_data); - g_free(date); - g_free(xhtml); + return written; } - static void xml_logger_finalize(GaimLog *log) +static void xml_logger_finalize(GaimLog *log) { - if (log->logger_data) { - fprintf(log->logger_data, "</conversation>\n"); - fclose(log->logger_data); - log->logger_data = NULL; + GaimLogCommonLoggerData *data = log->logger_data; + if (data) { + if (data->file) { + const char *date = gaim_utf8_strftime("%F %T%z", localtime(&log->time)); + fprintf(data->file, "\t<event time=\"%s\" type=\"logEnd\" \/>\n", date); + fprintf(data->file, "</conversation>\n"); + + fclose(data->file); + } + g_free(data->path); + + g_slice_free(GaimLogCommonLoggerData, data); } } static GList *xml_logger_list(GaimLogType type, const char *sn, GaimAccount *account) { - return gaim_log_common_lister(type, sn, account, ".xml", &xml_logger); + return gaim_log_common_lister(type, sn, account, ".chatlog", xml_logger); } -static GaimLogLogger xml_logger = { - N_("XML"), "xml", - NULL, - xml_logger_write, - xml_logger_finalize, - xml_logger_list, - NULL, - NULL, - NULL -}; -#endif +// xml_logger_Read +static int xml_logger_total_size(GaimLogType type, const char *name, GaimAccount *account) +{ + return gaim_log_common_total_sizer(type, name, account, ".chatlog"); +} + +static GList *xml_logger_list_syslog(GaimAccount *account) +{ + return gaim_log_common_lister(GAIM_LOG_SYSTEM, ".system", account, ".chatlog", html_logger); +} + /**************************** ** HTML LOGGER ************* ****************************/ Modified: branches/soc-2006-file-loggers/src/util.c =================================================================== --- branches/soc-2006-file-loggers/src/util.c 2006-06-06 17:42:02 UTC (rev 16226) +++ branches/soc-2006-file-loggers/src/util.c 2006-06-07 01:51:23 UTC (rev 16227) @@ -1342,7 +1342,7 @@ face = g_string_append_c(face, *q); q++; } - g_string_append_printf(style, "font-family: %s; ", face->str); + g_string_append_printf(style, "font-family: %s; ", g_strstrip(face->str)); g_string_free(face, TRUE); p = q; } else if(!g_ascii_strncasecmp(p, "size=", strlen("size="))) { @@ -1392,7 +1392,7 @@ pt->dest_tag = "span"; tags = g_list_prepend(tags, pt); if(style->len) - g_string_append_printf(xhtml, "<span style='%s'>", style->str); + g_string_append_printf(xhtml, "<span style='%s'>", g_strstrip(style->str)); else pt->ignore = TRUE; g_string_free(style, TRUE); @@ -1412,7 +1412,7 @@ color = g_string_append_c(color, *q); q++; } - g_string_append_printf(xhtml, "<span style='background: %s;'>", color->str); + g_string_append_printf(xhtml, "<span style='background: %s;'>", g_strstrip(color->str)); g_string_free(color, TRUE); if ((c = strchr(c, '>')) != NULL) c++; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aar...@us...> - 2006-06-06 22:00:52
|
Revision: 16226 Author: aaronsheldon Date: 2006-06-06 10:42:02 -0700 (Tue, 06 Jun 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16226&view=rev Log Message: ----------- Fixes a potential segfault in blist.c in gaim_blist_add_account where a check existed but was _after_ the questionable assignment. Modified Paths: -------------- branches/soc-2006-blist-efficiency/src/blist.c Modified: branches/soc-2006-blist-efficiency/src/blist.c =================================================================== --- branches/soc-2006-blist-efficiency/src/blist.c 2006-06-06 05:14:42 UTC (rev 16225) +++ branches/soc-2006-blist-efficiency/src/blist.c 2006-06-06 17:42:02 UTC (rev 16226) @@ -2244,10 +2244,11 @@ void gaim_blist_add_account(GaimAccount *account) { - GaimBlistUiOps *ops = gaimbuddylist->ui_ops; + GaimBlistUiOps *ops; GaimBlistNode *gnode, *cnode, *bnode; g_return_if_fail(gaimbuddylist != NULL); + ops = gaimbuddylist->ui_ops; if (!ops || !ops->update) return; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rl...@us...> - 2006-06-06 05:14:51
|
Revision: 16225 Author: rlaager Date: 2006-06-05 22:14:42 -0700 (Mon, 05 Jun 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16225&view=rev Log Message: ----------- Branch for roast to work on the various file-based logger enhancements. Added Paths: ----------- branches/soc-2006-file-loggers/ Copied: branches/soc-2006-file-loggers (from rev 16224, trunk) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rl...@us...> - 2006-06-06 05:11:42
|
Revision: 16224 Author: rlaager Date: 2006-06-05 22:11:32 -0700 (Mon, 05 Jun 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16224&view=rev Log Message: ----------- Branch for billatq to work on the DBI logger. Added Paths: ----------- branches/soc-2006-db-logger/ Copied: branches/soc-2006-db-logger (from rev 16223, trunk) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rl...@us...> - 2006-06-06 02:55:20
|
Revision: 16216 Author: rlaager Date: 2006-06-04 01:14:25 -0700 (Sun, 04 Jun 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16216&view=rev Log Message: ----------- Part of SF Patch #1500267 from Sadrul 'Fix for a couple of showstopper bugs on status + RFE "The message should be cleared when changing statuses, not saved as it is now." Modified Paths: -------------- trunk/src/gtkstatusbox.c Modified: trunk/src/gtkstatusbox.c =================================================================== --- trunk/src/gtkstatusbox.c 2006-06-04 07:40:13 UTC (rev 16215) +++ trunk/src/gtkstatusbox.c 2006-06-04 08:14:25 UTC (rev 16216) @@ -1465,18 +1465,12 @@ { if (status_box->imhtml_visible) { - GtkTextBuffer *buf; - GtkTextIter start, end; gtk_widget_show_all(status_box->vbox); if (GTK_WIDGET_IS_SENSITIVE(GTK_WIDGET(status_box))) { status_box->typing = g_timeout_add(TYPING_TIMEOUT, (GSourceFunc)remove_typing_cb, status_box); } gtk_widget_grab_focus(status_box->imhtml); - buf = gtk_text_view_get_buffer(GTK_TEXT_VIEW(status_box->imhtml)); - gtk_text_buffer_get_start_iter(buf, &start); - gtk_text_buffer_get_end_iter(buf, &end); - gtk_text_buffer_move_mark_by_name(buf, "insert", &end); - gtk_text_buffer_move_mark_by_name(buf, "selection_bound", &start); + gtk_imhtml_clear(GTK_IMHTML(status_box->imhtml)); } else { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rl...@us...> - 2006-06-06 02:55:17
|
Revision: 16217 Author: rlaager Date: 2006-06-04 01:19:51 -0700 (Sun, 04 Jun 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16217&view=rev Log Message: ----------- The last of SF Patch #1500267 from Sadrul "if you press Escape when changing the status, it discards the changes and restores the statusbox to reflect current status." Modified Paths: -------------- trunk/src/gtkstatusbox.c Modified: trunk/src/gtkstatusbox.c =================================================================== --- trunk/src/gtkstatusbox.c 2006-06-04 08:14:25 UTC (rev 16216) +++ trunk/src/gtkstatusbox.c 2006-06-04 08:19:51 UTC (rev 16217) @@ -738,6 +738,16 @@ } if (!status_box->typing != 0) return FALSE; + + /* Reset the status if Escape was pressed */ + if (event->keyval == GDK_Escape) + { + g_source_remove(status_box->typing); + status_box->typing = 0; + status_menu_refresh_iter(status_box); + return TRUE; + } + gtk_gaim_status_box_pulse_typing(status_box); g_source_remove(status_box->typing); status_box->typing = g_timeout_add(TYPING_TIMEOUT, (GSourceFunc)remove_typing_cb, status_box); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sea...@us...> - 2006-06-06 02:48:30
|
Revision: 16219 Author: seanegan Date: 2006-06-05 10:29:14 -0700 (Mon, 05 Jun 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16219&view=rev Log Message: ----------- Happy, Ethan? Added Paths: ----------- branches/v2_0_0/ Removed Paths: ------------- branches/v2_0_0-branch/ Copied: branches/v2_0_0 (from rev 16218, branches/v2_0_0-branch) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sea...@us...> - 2006-06-06 02:15:37
|
Revision: 16218 Author: seanegan Date: 2006-06-05 10:25:21 -0700 (Mon, 05 Jun 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16218&view=rev Log Message: ----------- branch for 2.0.0. Added Paths: ----------- branches/v2_0_0-branch/ Copied: branches/v2_0_0-branch (from rev 16217, trunk) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rl...@us...> - 2006-06-06 01:49:57
|
Revision: 16215 Author: rlaager Date: 2006-06-04 00:40:13 -0700 (Sun, 04 Jun 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16215&view=rev Log Message: ----------- Part of SF Patch #1500267 from Sadrul 'Fix for a couple of showstopper bugs on status + RFE "Changing from a saved status based on "Available" with a couple accounts Offline to the primitive "Available" didn't do anything. It showed Available - Typing, I think, but then didn't change my status. deryni confirmed this."' Modified Paths: -------------- trunk/src/gtkstatusbox.c Modified: trunk/src/gtkstatusbox.c =================================================================== --- trunk/src/gtkstatusbox.c 2006-06-04 06:37:25 UTC (rev 16214) +++ trunk/src/gtkstatusbox.c 2006-06-04 07:40:13 UTC (rev 16215) @@ -1267,7 +1267,8 @@ /* Has the status really been changed? */ saved_status = gaim_savedstatus_get_current(); - if (gaim_savedstatus_get_type(saved_status) == GPOINTER_TO_INT(data)) + if (gaim_savedstatus_get_type(saved_status) == GPOINTER_TO_INT(data) && + !gaim_savedstatus_has_substatuses(saved_status)) { if (!message_changed(gaim_savedstatus_get_message(saved_status), message)) changed = FALSE; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rl...@us...> - 2006-06-06 01:49:37
|
Revision: 16214 Author: rlaager Date: 2006-06-03 23:37:25 -0700 (Sat, 03 Jun 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16214&view=rev Log Message: ----------- SF Patch #1500190 from resiak "Lots of people ask how to make Escape close the conversation window, and the FAQ doesn't say how. With this patch, there will be! (Plus, if you apply now you get a free set of "emacs" keybindings.)" Modified Paths: -------------- web/htdocs/faq2.txt Modified: web/htdocs/faq2.txt =================================================================== --- web/htdocs/faq2.txt 2006-06-04 06:34:30 UTC (rev 16213) +++ web/htdocs/faq2.txt 2006-06-04 06:37:25 UTC (rev 16214) @@ -325,6 +325,18 @@ <code>gtk-can-change-accels = 1</code>, then you hover over the menu item then press your desired key stroke. +Q: How do I make Escape close the conversation window? + +A: Sadly, you can't use the hover-and-press technique just described +for this, because Escape closes the menu. You have to hand-edit +<code>~/.gaim/accels</code>. Close Gaim, and open +<code>~/.gaim/accels</code> in your favorite text editor. Find +<code>(gtk_accel_path "<main>/Conversation/Close" +"[something]")</code>, remove the semi-colon (which is the comment +character) from the start of the line if it is there and replace whatever +is between the second pair of quote marks with <code>Escape</code>. Save +and close, and restart Gaim. + Q: How do I use smiley themes? A: To select a theme, open Gaim's preferences to the "Smiley Themes" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |