From: <ro...@us...> - 2006-06-24 18:12:35
|
Revision: 16330 Author: roast Date: 2006-06-24 11:11:59 -0700 (Sat, 24 Jun 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16330&view=rev Log Message: ----------- merged with svn trunk, r16329 Modified Paths: -------------- branches/soc-2006-file-loggers/COPYRIGHT branches/soc-2006-file-loggers/configure.ac branches/soc-2006-file-loggers/doc/plugin-ids.dox branches/soc-2006-file-loggers/plugins/ChangeLog.API branches/soc-2006-file-loggers/plugins/idle.c branches/soc-2006-file-loggers/plugins/perl/common/Account.xs branches/soc-2006-file-loggers/plugins/perl/common/Conversation.xs branches/soc-2006-file-loggers/plugins/perl/common/Server.xs branches/soc-2006-file-loggers/plugins/tcl/Makefile.am branches/soc-2006-file-loggers/plugins/tcl/Makefile.mingw branches/soc-2006-file-loggers/plugins/tcl/tcl.c branches/soc-2006-file-loggers/plugins/tcl/tcl_cmds.c branches/soc-2006-file-loggers/plugins/tcl/tcl_gaim.h branches/soc-2006-file-loggers/plugins/tcl/tcl_signals.c branches/soc-2006-file-loggers/src/cmds.h branches/soc-2006-file-loggers/src/conversation.c branches/soc-2006-file-loggers/src/conversation.h branches/soc-2006-file-loggers/src/ft.c branches/soc-2006-file-loggers/src/gtkblist.c branches/soc-2006-file-loggers/src/gtkconv.c branches/soc-2006-file-loggers/src/gtkconv.h branches/soc-2006-file-loggers/src/gtkmain.c branches/soc-2006-file-loggers/src/gtkpounce.c branches/soc-2006-file-loggers/src/gtksavedstatuses.c branches/soc-2006-file-loggers/src/gtkstatusbox.c branches/soc-2006-file-loggers/src/pounce.c branches/soc-2006-file-loggers/src/pounce.h branches/soc-2006-file-loggers/src/protocols/irc/cmds.c branches/soc-2006-file-loggers/src/protocols/jabber/message.c branches/soc-2006-file-loggers/src/protocols/jabber/message.h branches/soc-2006-file-loggers/src/protocols/msn/msn.c branches/soc-2006-file-loggers/src/protocols/novell/novell.c branches/soc-2006-file-loggers/src/protocols/oscar/oscar.c branches/soc-2006-file-loggers/src/protocols/sametime/sametime.c branches/soc-2006-file-loggers/src/protocols/simple/simple.c branches/soc-2006-file-loggers/src/protocols/yahoo/yahoo.c branches/soc-2006-file-loggers/src/protocols/yahoo/yahoo.h branches/soc-2006-file-loggers/src/protocols/yahoo/yahoo_filexfer.c branches/soc-2006-file-loggers/src/protocols/zephyr/zephyr.c branches/soc-2006-file-loggers/src/prpl.h branches/soc-2006-file-loggers/src/server.c branches/soc-2006-file-loggers/src/server.h branches/soc-2006-file-loggers/src/xmlnode.c Modified: branches/soc-2006-file-loggers/COPYRIGHT =================================================================== --- branches/soc-2006-file-loggers/COPYRIGHT 2006-06-24 12:04:32 UTC (rev 16329) +++ branches/soc-2006-file-loggers/COPYRIGHT 2006-06-24 18:11:59 UTC (rev 16330) @@ -51,6 +51,7 @@ Christophe Chapuis Ka-Hing Cheung Sadrul Habib Chowdhury +Brian Chu Arturo Cisneros, Jr. Vincas Ciziunas Jonathan Clark Modified: branches/soc-2006-file-loggers/configure.ac =================================================================== --- branches/soc-2006-file-loggers/configure.ac 2006-06-24 12:04:32 UTC (rev 16329) +++ branches/soc-2006-file-loggers/configure.ac 2006-06-24 18:11:59 UTC (rev 16330) @@ -163,7 +163,11 @@ dnl # GStreamer dnl ####################################################################### enable_gst=yes -PKG_CHECK_MODULES(GSTREAMER, gstreamer-0.10, ,enable_gst=no) +PKG_CHECK_MODULES(GSTREAMER, [gstreamer-0.10], , + [ + AC_MSG_RESULT(no) + enable_gst=no + ]) AC_SUBST(GSTREAMER_CFLAGS) AC_SUBST(GSTREAMER_LIBS) AC_ARG_ENABLE(gstreamer,[ --disable-gstreamer compile without GStreamer audio support],enable_gst=no) @@ -175,7 +179,11 @@ dnl # LibXML2 dnl ################# enable_libxml2=yes -PKG_CHECK_MODULES(LIBXML, libxml-2.0, ,enable_libxml2=no) +PKG_CHECK_MODULES(LIBXML, [libxml-2.0], , + [ + AC_MSG_RESULT(no) + enable_libxml2=no + ]) AC_SUBST(LIBXML_CFLAGS) AC_SUBST(LIBXML_LIBS) AC_ARG_ENABLE(libxml,[ --disable-libxml compile without libxml2 support],enable_libxml2=no) @@ -690,7 +698,7 @@ PYTHON=$withval) if test "x$enable_dbus" = "xyes" ; then - if test -z "$PYTHON" ; then + if test -z "$PYTHON" -o "x$PYTHON" = "xyes"; then AC_PATH_PROG([PYTHON], [python], [no]) fi Modified: branches/soc-2006-file-loggers/doc/plugin-ids.dox =================================================================== --- branches/soc-2006-file-loggers/doc/plugin-ids.dox 2006-06-24 12:04:32 UTC (rev 16329) +++ branches/soc-2006-file-loggers/doc/plugin-ids.dox 2006-06-24 18:11:59 UTC (rev 16330) @@ -28,10 +28,7 @@ - qpe - Gaim for Qtopia plugin. The @em username must be a unique identifier for that person. It - @em should be your Gaim website user ID - (registered <a href="http://gaim.sourceforge.net/register.php">here</a>). - If for some reason you cannot register there (it shouldn't be a - problem!), you can use your SourceForge ID. Do @em not leave this field + @em should be your SourceForge ID. Do @em not leave this field blank. The @em pluginname is the name of your plugin. It can be whatever you like, Modified: branches/soc-2006-file-loggers/plugins/ChangeLog.API =================================================================== --- branches/soc-2006-file-loggers/plugins/ChangeLog.API 2006-06-24 12:04:32 UTC (rev 16329) +++ branches/soc-2006-file-loggers/plugins/ChangeLog.API 2006-06-24 18:11:59 UTC (rev 16330) @@ -114,6 +114,7 @@ gaim_proxy_connect() and gaim_network_listen*(). * gaim_gtk_create_imhtml(): Added sw_ret() parameter * gaim_account_get_log(): Added create parameter + * GAIM_CMD_P_VERYHIGH is now GAIM_CMD_P_VERY_HIGH Removed: * gaim_gtk_sound_{get,set}_mute() (replaced by the /gaim/gtk/sound/mute @@ -173,6 +174,8 @@ * GAIM_MESSAGE_COLORIZE * user_data from gaim_notify_searchresults_new_rows and from notify_searchresults in GaimNotifyUiOps. + * gaim_conversation_get_send_history(), and send_history from + GaimConversation Added: * gaim_prefs_disconnect_by_handle() Modified: branches/soc-2006-file-loggers/plugins/idle.c =================================================================== --- branches/soc-2006-file-loggers/plugins/idle.c 2006-06-24 12:04:32 UTC (rev 16329) +++ branches/soc-2006-file-loggers/plugins/idle.c 2006-06-24 18:11:59 UTC (rev 16330) @@ -102,12 +102,13 @@ idle_all_action_ok(void *ignored, GaimRequestFields *fields) { GaimAccount *acct = NULL; - GList *l = gaim_accounts_get_all_active(); + GList *list, *iter; int tm = gaim_request_fields_get_integer(fields, "mins"); const char *prpl_id = NULL; - for(; l; l = l->next) { - acct = (GaimAccount *)(l->data); + list = gaim_accounts_get_all_active(); + for(iter = list; iter; iter = iter->next) { + acct = (GaimAccount *)(iter->data); if(acct) prpl_id = gaim_account_get_protocol_id(acct); @@ -122,6 +123,8 @@ idled_accts = g_list_append(idled_accts, acct); } } + + g_list_free(list); } static void Modified: branches/soc-2006-file-loggers/plugins/perl/common/Account.xs =================================================================== --- branches/soc-2006-file-loggers/plugins/perl/common/Account.xs 2006-06-24 12:04:32 UTC (rev 16329) +++ branches/soc-2006-file-loggers/plugins/perl/common/Account.xs 2006-06-24 18:11:59 UTC (rev 16330) @@ -286,11 +286,13 @@ void gaim_accounts_get_all_active() PREINIT: - GList *l; + GList *list, *iter; PPCODE: - for (l = gaim_accounts_get_all_active(); l != NULL; l = l->next) { - XPUSHs(sv_2mortal(gaim_perl_bless_object(l->data, "Gaim::Account"))); + list = gaim_accounts_get_all_active(); + for (iter = gaim_accounts_get_all_active(); iter != NULL; iter = iter->next) { + XPUSHs(sv_2mortal(gaim_perl_bless_object(iter->data, "Gaim::Account"))); } + g_list_free(list); Gaim::Account gaim_accounts_find(name, protocol) Modified: branches/soc-2006-file-loggers/plugins/perl/common/Conversation.xs =================================================================== --- branches/soc-2006-file-loggers/plugins/perl/common/Conversation.xs 2006-06-24 12:04:32 UTC (rev 16329) +++ branches/soc-2006-file-loggers/plugins/perl/common/Conversation.xs 2006-06-24 18:11:59 UTC (rev 16330) @@ -46,16 +46,6 @@ PROTOTYPES: ENABLE void -gaim_conversation_get_send_history(conv) - Gaim::Conversation conv -PREINIT: - GList *l; -PPCODE: - for (l = gaim_conversation_get_send_history(conv); l != NULL; l = l->next) { - XPUSHs(sv_2mortal(newSVpv(l->data, 0))); - } - -void gaim_conversation_destroy(conv) Gaim::Conversation conv @@ -189,15 +179,15 @@ Gaim::Conversation::IM im void -gaim_conv_im_start_type_again_timeout(im) +gaim_conv_im_start_send_typed_timeout(im) Gaim::Conversation::IM im void -gaim_conv_im_stop_type_again_timeout(im) +gaim_conv_im_stop_send_typed_timeout(im) Gaim::Conversation::IM im guint -gaim_conv_im_get_type_again_timeout(im) +gaim_conv_im_get_send_typed_timeout(im) Gaim::Conversation::IM im void Modified: branches/soc-2006-file-loggers/plugins/perl/common/Server.xs =================================================================== --- branches/soc-2006-file-loggers/plugins/perl/common/Server.xs 2006-06-24 12:04:32 UTC (rev 16329) +++ branches/soc-2006-file-loggers/plugins/perl/common/Server.xs 2006-06-24 18:11:59 UTC (rev 16330) @@ -200,10 +200,10 @@ Gaim::MessageFlags flags int -serv_send_typing(con, a, b) +serv_send_typing(con, a, state) Gaim::Connection con const char * a - int b + Gaim::TypingState state void serv_set_buddyicon(gc, filename) Modified: branches/soc-2006-file-loggers/plugins/tcl/Makefile.am =================================================================== --- branches/soc-2006-file-loggers/plugins/tcl/Makefile.am 2006-06-24 12:04:32 UTC (rev 16329) +++ branches/soc-2006-file-loggers/plugins/tcl/Makefile.am 2006-06-24 18:11:59 UTC (rev 16330) @@ -5,7 +5,7 @@ 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_ref.c + tcl_ref.c tcl_cmd.c EXTRA_DIST = signal-test.tcl Makefile.mingw Modified: branches/soc-2006-file-loggers/plugins/tcl/Makefile.mingw =================================================================== --- branches/soc-2006-file-loggers/plugins/tcl/Makefile.mingw 2006-06-24 12:04:32 UTC (rev 16329) +++ branches/soc-2006-file-loggers/plugins/tcl/Makefile.mingw 2006-06-24 18:11:59 UTC (rev 16330) @@ -61,6 +61,7 @@ ## C_SRC = tcl.c \ + tcl_cmd.c \ tcl_cmds.c \ tcl_glib.c \ tcl_ref.c \ Modified: branches/soc-2006-file-loggers/plugins/tcl/tcl.c =================================================================== --- branches/soc-2006-file-loggers/plugins/tcl/tcl.c 2006-06-24 12:04:32 UTC (rev 16329) +++ branches/soc-2006-file-loggers/plugins/tcl/tcl.c 2006-06-24 18:11:59 UTC (rev 16330) @@ -126,6 +126,7 @@ Tcl_CreateObjCommand(interp, "::gaim::account", tcl_cmd_account, (ClientData)NULL, NULL); Tcl_CreateObjCommand(interp, "::gaim::buddy", tcl_cmd_buddy, (ClientData)NULL, NULL); + Tcl_CreateObjCommand(interp, "::gaim::cmd", tcl_cmd_cmd, (ClientData)NULL, NULL); Tcl_CreateObjCommand(interp, "::gaim::connection", tcl_cmd_connection, (ClientData)NULL, NULL); Tcl_CreateObjCommand(interp, "::gaim::conversation", tcl_cmd_conversation, (ClientData)NULL, NULL); Tcl_CreateObjCommand(interp, "::gaim::core", tcl_cmd_core, (ClientData)NULL, NULL); @@ -284,7 +285,9 @@ if (Tcl_EvalFile(interp, plugin->path) != TCL_OK) { result = Tcl_GetObjResult(interp); - gaim_debug(GAIM_DEBUG_ERROR, "tcl", "Error evaluating %s: %s\n", plugin->path, Tcl_GetString(result)); + gaim_debug(GAIM_DEBUG_ERROR, "tcl", + "Error evaluating %s: %s\n", plugin->path, + Tcl_GetString(result)); Tcl_DeleteInterp(interp); return FALSE; } @@ -313,6 +316,7 @@ if (data != NULL) { g_hash_table_remove(tcl_plugins, (gpointer)(data->interp)); gaim_signals_disconnect_by_handle(data->interp); + tcl_cmd_cleanup(data->interp); tcl_signal_cleanup(data->interp); Tcl_Release((ClientData)data->interp); Tcl_DeleteInterp(data->interp); @@ -341,6 +345,7 @@ if(!tcl_loaded) return FALSE; tcl_glib_init(); + tcl_cmd_init(); tcl_signal_init(); gaim_tcl_ref_init(); Modified: branches/soc-2006-file-loggers/plugins/tcl/tcl_cmds.c =================================================================== --- branches/soc-2006-file-loggers/plugins/tcl/tcl_cmds.c 2006-06-24 12:04:32 UTC (rev 16329) +++ branches/soc-2006-file-loggers/plugins/tcl/tcl_cmds.c 2006-06-24 18:11:59 UTC (rev 16330) @@ -73,7 +73,7 @@ return convo; } if (interp != NULL) - Tcl_SetStringObj(Tcl_GetObjResult(interp), "invalid account", -1); + Tcl_SetStringObj(Tcl_GetObjResult(interp), "invalid conversation", -1); return NULL; } @@ -541,6 +541,70 @@ return TCL_OK; } +int tcl_cmd_cmd(ClientData unused, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) +{ + const char *cmds[] = { "register", "unregister", NULL }; + enum { CMD_CMD_REGISTER, CMD_CMD_UNREGISTER } cmd; + struct tcl_cmd_handler *handler; + Tcl_Obj *result = Tcl_GetObjResult(interp); + GaimCmdId id; + 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_CMD_REGISTER: + if (objc != 9) { + Tcl_WrongNumArgs(interp, 2, objv, "cmd arglist priority flags prpl_id proc helpstr"); + return TCL_ERROR; + } + handler = g_new0(struct tcl_cmd_handler, 1); + handler->cmd = objv[2]; + handler->args = Tcl_GetString(objv[3]); + handler->nargs = strlen(handler->args); + if ((error = Tcl_GetIntFromObj(interp, objv[4], + &handler->priority)) != TCL_OK) { + g_free(handler); + return error; + } + if ((error = Tcl_GetIntFromObj(interp, objv[5], + &handler->flags)) != TCL_OK) { + g_free(handler); + return error; + } + handler->prpl_id = Tcl_GetString(objv[6]); + handler->proc = objv[7]; + handler->helpstr = Tcl_GetString(objv[8]); + handler->interp = interp; + if ((id = tcl_cmd_register(handler)) == 0) { + tcl_cmd_handler_free(handler); + Tcl_SetIntObj(result, 0); + } else { + handler->id = id; + Tcl_SetIntObj(result, id); + } + break; + case CMD_CMD_UNREGISTER: + if (objc != 3) { + Tcl_WrongNumArgs(interp, 2, objv, "id"); + return TCL_ERROR; + } + if ((error = Tcl_GetIntFromObj(interp, objv[2], + (int *)&id)) != TCL_OK) + return error; + tcl_cmd_unregister(id, interp); + break; + } + + return TCL_OK; +} + int tcl_cmd_connection(ClientData unused, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { Tcl_Obj *result = Tcl_GetObjResult(interp), *list, *elem; Modified: branches/soc-2006-file-loggers/plugins/tcl/tcl_gaim.h =================================================================== --- branches/soc-2006-file-loggers/plugins/tcl/tcl_gaim.h 2006-06-24 12:04:32 UTC (rev 16329) +++ branches/soc-2006-file-loggers/plugins/tcl/tcl_gaim.h 2006-06-24 18:11:59 UTC (rev 16330) @@ -26,6 +26,7 @@ #include <tcl.h> #include "internal.h" +#include "cmds.h" #include "plugin.h" #include "value.h" #include "stringref.h" @@ -45,6 +46,23 @@ GaimValue **argtypes; }; +struct tcl_cmd_handler { + int id; + Tcl_Obj *cmd; + Tcl_Interp *interp; + + Tcl_Obj *namespace; + /* These are temporary during setup */ + const char *args; + int priority; + int flags; + const char *prpl_id; + Tcl_Obj *proc; + const char *helpstr; + + int nargs; +}; + extern GaimPlugin *_tcl_plugin; /* Capitalized this way because these are "types" */ @@ -65,6 +83,12 @@ gboolean tcl_signal_connect(struct tcl_signal_handler *handler); void tcl_signal_disconnect(void *instance, const char *signal, Tcl_Interp *interp); +void tcl_cmd_init(void); +void tcl_cmd_handler_free(struct tcl_cmd_handler *handler); +void tcl_cmd_cleanup(Tcl_Interp *interp); +GaimCmdId tcl_cmd_register(struct tcl_cmd_handler *handler); +void tcl_cmd_unregister(GaimCmdId id, Tcl_Interp *interp); + void gaim_tcl_ref_init(void); void *gaim_tcl_ref_get(Tcl_Interp *interp, Tcl_Obj *obj, GaimStringref *type); Tcl_Obj *gaim_tcl_ref_new(GaimStringref *type, void *value); @@ -72,6 +96,7 @@ Tcl_ObjCmdProc tcl_cmd_account; Tcl_ObjCmdProc tcl_cmd_signal_connect; Tcl_ObjCmdProc tcl_cmd_buddy; +Tcl_ObjCmdProc tcl_cmd_cmd; Tcl_ObjCmdProc tcl_cmd_connection; Tcl_ObjCmdProc tcl_cmd_conversation; Tcl_ObjCmdProc tcl_cmd_core; Modified: branches/soc-2006-file-loggers/plugins/tcl/tcl_signals.c =================================================================== --- branches/soc-2006-file-loggers/plugins/tcl/tcl_signals.c 2006-06-24 12:04:32 UTC (rev 16329) +++ branches/soc-2006-file-loggers/plugins/tcl/tcl_signals.c 2006-06-24 18:11:59 UTC (rev 16330) @@ -387,7 +387,6 @@ g_string_free(val, TRUE); g_free(vals); g_free(strs); - return retval; } Modified: branches/soc-2006-file-loggers/src/cmds.h =================================================================== --- branches/soc-2006-file-loggers/src/cmds.h 2006-06-24 12:04:32 UTC (rev 16329) +++ branches/soc-2006-file-loggers/src/cmds.h 2006-06-24 18:11:59 UTC (rev 16330) @@ -56,14 +56,14 @@ typedef guint GaimCmdId; enum _GaimCmdPriority { - GAIM_CMD_P_VERY_LOW = -1000, - GAIM_CMD_P_LOW = 0, - GAIM_CMD_P_DEFAULT = 1000, - GAIM_CMD_P_PRPL = 2000, - GAIM_CMD_P_PLUGIN = 3000, - GAIM_CMD_P_ALIAS = 4000, - GAIM_CMD_P_HIGH = 5000, - GAIM_CMD_P_VERYHIGH = 6000, + GAIM_CMD_P_VERY_LOW = -1000, + GAIM_CMD_P_LOW = 0, + GAIM_CMD_P_DEFAULT = 1000, + GAIM_CMD_P_PRPL = 2000, + GAIM_CMD_P_PLUGIN = 3000, + GAIM_CMD_P_ALIAS = 4000, + GAIM_CMD_P_HIGH = 5000, + GAIM_CMD_P_VERY_HIGH = 6000, }; enum _GaimCmdFlag { @@ -111,11 +111,11 @@ * @param f These are the flags. You need to at least pass one of GAIM_CMD_FLAG_IM or * GAIM_CMD_FLAG_CHAT (can may pass both) in order for the command to ever actually * be called. - * @param prpl_id This is the prpl's id string. This is only meaningful is the proper flag is set. + * @param prpl_id This is the prpl's id string. This is only meaningful if the proper flag is set. * @param func This is the function to call when someone enters this command. * @param helpstr This is a whitespace sensitive, UTF-8, HTML string describing how to use the command. * The preferred format of this string shall be the commands name, followed by a space - * and any arguments it accpets (if it takes any arguments, otherwise no space), follow + * and any arguments it accepts (if it takes any arguments, otherwise no space), followed * by a colon, two spaces, and a description of the command in sentence form. No slash * before the command name. * @param data User defined data to pass to the GaimCmdFunc Modified: branches/soc-2006-file-loggers/src/conversation.c =================================================================== --- branches/soc-2006-file-loggers/src/conversation.c 2006-06-24 12:04:32 UTC (rev 16329) +++ branches/soc-2006-file-loggers/src/conversation.c 2006-06-24 18:11:59 UTC (rev 16330) @@ -46,39 +46,44 @@ } static gboolean -reset_typing(gpointer data) +reset_typing_cb(gpointer data) { GaimConversation *c = (GaimConversation *)data; GaimConvIm *im; - if (!g_list_find(conversations, c)) - return FALSE; - im = GAIM_CONV_IM(c); gaim_conv_im_set_typing_state(im, GAIM_NOT_TYPING); gaim_conv_im_update_typing(im); gaim_conv_im_stop_typing_timeout(im); + gaim_signal_emit(gaim_conversations_get_handle(), + "buddy-typing-stopped", c->account, c->name); + return FALSE; } static gboolean -send_typed(gpointer data) +send_typed_cb(gpointer data) { GaimConversation *conv = (GaimConversation *)data; GaimConnection *gc; const char *name; g_return_val_if_fail(conv != NULL, FALSE); - + gc = gaim_conversation_get_gc(conv); name = gaim_conversation_get_name(conv); if (gc != NULL && name != NULL) { - gaim_conv_im_set_type_again(GAIM_CONV_IM(conv), TRUE); + /* We set this to 1 so that GAIM_TYPING will be sent + * if the Gaim user types anything else. + */ + gaim_conv_im_set_type_again(GAIM_CONV_IM(conv), 1); serv_send_typing(gc, name, GAIM_TYPED); + gaim_signal_emit(gaim_conversations_get_handle(), + "buddy-typed", conv->account, conv->name); gaim_debug(GAIM_DEBUG_MISC, "conversation", "typed...\n"); } @@ -263,7 +268,6 @@ conv->account = account; conv->name = g_strdup(name); conv->title = g_strdup(name); - conv->send_history = g_list_append(NULL, NULL); conv->data = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, NULL); /* copy features from the connection. */ @@ -419,20 +423,9 @@ conv->name = NULL; conv->title = NULL; - for (node = g_list_first(conv->send_history); - node != NULL; - node = g_list_next(node)) { - - if (node->data != NULL) - g_free(node->data); - node->data = NULL; - } - - g_list_free(g_list_first(conv->send_history)); - if (conv->type == GAIM_CONV_TYPE_IM) { gaim_conv_im_stop_typing_timeout(conv->u.im); - gaim_conv_im_stop_type_again_timeout(conv->u.im); + gaim_conv_im_stop_send_typed_timeout(conv->u.im); if (conv->u.im->icon != NULL) gaim_buddy_icon_unref(conv->u.im->icon); @@ -708,14 +701,6 @@ conv->logs = NULL; } -GList * -gaim_conversation_get_send_history(const GaimConversation *conv) -{ - g_return_val_if_fail(conv != NULL, NULL); - - return conv->send_history; -} - GaimConvIm * gaim_conversation_get_im_data(const GaimConversation *conv) { @@ -1006,9 +991,14 @@ gaim_signal_emit(gaim_conversations_get_handle(), "buddy-typing", im->conv->account, im->conv->name); } - else + else if (state == GAIM_TYPED) { gaim_signal_emit(gaim_conversations_get_handle(), + "buddy-typed", im->conv->account, im->conv->name); + } + else if (state == GAIM_NOT_TYPING) + { + gaim_signal_emit(gaim_conversations_get_handle(), "buddy-typing-stopped", im->conv->account, im->conv->name); } } @@ -1036,7 +1026,7 @@ conv = gaim_conv_im_get_conversation(im); name = gaim_conversation_get_name(conv); - im->typing_timeout = gaim_timeout_add(timeout * 1000, reset_typing, conv); + im->typing_timeout = gaim_timeout_add(timeout * 1000, reset_typing_cb, conv); } void @@ -1060,11 +1050,14 @@ } void -gaim_conv_im_set_type_again(GaimConvIm *im, time_t val) +gaim_conv_im_set_type_again(GaimConvIm *im, unsigned int val) { g_return_if_fail(im != NULL); - im->type_again = val; + if (val == 0) + im->type_again = 0; + else + im->type_again = time(NULL) + val; } time_t @@ -1076,32 +1069,32 @@ } void -gaim_conv_im_start_type_again_timeout(GaimConvIm *im) +gaim_conv_im_start_send_typed_timeout(GaimConvIm *im) { g_return_if_fail(im != NULL); - im->type_again_timeout = gaim_timeout_add(SEND_TYPED_TIMEOUT, send_typed, + im->send_typed_timeout = gaim_timeout_add(SEND_TYPED_TIMEOUT, send_typed_cb, gaim_conv_im_get_conversation(im)); } void -gaim_conv_im_stop_type_again_timeout(GaimConvIm *im) +gaim_conv_im_stop_send_typed_timeout(GaimConvIm *im) { g_return_if_fail(im != NULL); - if (im->type_again_timeout == 0) + if (im->send_typed_timeout == 0) return; - gaim_timeout_remove(im->type_again_timeout); - im->type_again_timeout = 0; + gaim_timeout_remove(im->send_typed_timeout); + im->send_typed_timeout = 0; } guint -gaim_conv_im_get_type_again_timeout(const GaimConvIm *im) +gaim_conv_im_get_send_typed_timeout(const GaimConvIm *im) { g_return_val_if_fail(im != NULL, 0); - return im->type_again_timeout; + return im->send_typed_timeout; } void @@ -2110,6 +2103,12 @@ GAIM_SUBTYPE_ACCOUNT), gaim_value_new(GAIM_TYPE_STRING)); + gaim_signal_register(handle, "buddy-typed", + gaim_marshal_VOID__POINTER_POINTER, NULL, 2, + gaim_value_new(GAIM_TYPE_SUBTYPE, + GAIM_SUBTYPE_ACCOUNT), + gaim_value_new(GAIM_TYPE_STRING)); + gaim_signal_register(handle, "buddy-typing-stopped", gaim_marshal_VOID__POINTER_POINTER, NULL, 2, gaim_value_new(GAIM_TYPE_SUBTYPE, Modified: branches/soc-2006-file-loggers/src/conversation.h =================================================================== --- branches/soc-2006-file-loggers/src/conversation.h 2006-06-24 12:04:32 UTC (rev 16329) +++ branches/soc-2006-file-loggers/src/conversation.h 2006-06-24 18:11:59 UTC (rev 16330) @@ -186,7 +186,7 @@ GaimTypingState typing_state; /**< The current typing state. */ guint typing_timeout; /**< The typing timer handle. */ time_t type_again; /**< The type again time. */ - guint type_again_timeout; /**< The type again timer handle. */ + guint send_typed_timeout; /**< The type again timer handle. */ GaimBuddyIcon *icon; /**< The buddy icon. */ }; @@ -236,8 +236,6 @@ GList *logs; /**< This conversation's logs */ - GList *send_history; /**< The send history. */ - union { GaimConvIm *im; /**< IM-specific data. */ @@ -441,15 +439,6 @@ void gaim_conversation_close_logs(GaimConversation *conv); /** - * Returns the specified conversation's send history. - * - * @param conv The conversation. - * - * @return The conversation's send history. - */ -GList *gaim_conversation_get_send_history(const GaimConversation *conv); - -/** * Returns the specified conversation's IM-specific data. * * If the conversation type is not GAIM_CONV_TYPE_IM, this will return @c NULL. @@ -677,19 +666,25 @@ guint gaim_conv_im_get_typing_timeout(const GaimConvIm *im); /** - * Sets the IM's time until it should send another typing notification. + * Sets the quiet-time when no GAIM_TYPING messages will be sent. + * Few protocols need this (maybe only MSN). If the user is still + * typing after this quiet-period, then another GAIM_TYPING message + * will be sent. * * @param im The IM. - * @param val The time. + * @param val The number of seconds to wait before allowing another + * GAIM_TYPING message to be sent to the user. Or 0 to + * not send another GAIM_TYPING message. */ -void gaim_conv_im_set_type_again(GaimConvIm *im, time_t val); +void gaim_conv_im_set_type_again(GaimConvIm *im, unsigned int val); /** - * Returns the IM's time until it should send another typing notification. + * Returns the time after which another GAIM_TYPING message should be sent. * * @param im The IM. * - * @return The time. + * @return The time in seconds since the epoch. Or 0 if no additional + * GAIM_TYPING message should be sent. */ time_t gaim_conv_im_get_type_again(const GaimConvIm *im); @@ -698,14 +693,14 @@ * * @param im The IM. */ -void gaim_conv_im_start_type_again_timeout(GaimConvIm *im); +void gaim_conv_im_start_send_typed_timeout(GaimConvIm *im); /** * Stops the IM's type again timeout. * * @param im The IM. */ -void gaim_conv_im_stop_type_again_timeout(GaimConvIm *im); +void gaim_conv_im_stop_send_typed_timeout(GaimConvIm *im); /** * Returns the IM's type again timeout interval. @@ -714,7 +709,7 @@ * * @return The type again timeout interval. */ -guint gaim_conv_im_get_type_again_timeout(const GaimConvIm *im); +guint gaim_conv_im_get_send_typed_timeout(const GaimConvIm *im); /** * Updates the visual typing notification for an IM conversation. Modified: branches/soc-2006-file-loggers/src/ft.c =================================================================== --- branches/soc-2006-file-loggers/src/ft.c 2006-06-24 12:04:32 UTC (rev 16329) +++ branches/soc-2006-file-loggers/src/ft.c 2006-06-24 18:11:59 UTC (rev 16330) @@ -388,8 +388,9 @@ gaim_xfer_get_status(xfer) == GAIM_XFER_STATUS_ACCEPTED) { gchar* message = NULL; + GaimBuddy *buddy = gaim_find_buddy(xfer->account, xfer->who); message = g_strdup_printf(_("%s is offering to send file %s"), - xfer->who, gaim_xfer_get_filename(xfer)); + buddy ? gaim_buddy_get_alias(buddy) : xfer->who, gaim_xfer_get_filename(xfer)); gaim_xfer_conversation_write(xfer, message, FALSE); g_free(message); /* Ask for a filename to save to if it's not already given by a plugin */ Modified: branches/soc-2006-file-loggers/src/gtkblist.c =================================================================== --- branches/soc-2006-file-loggers/src/gtkblist.c 2006-06-24 12:04:32 UTC (rev 16329) +++ branches/soc-2006-file-loggers/src/gtkblist.c 2006-06-24 18:11:59 UTC (rev 16330) @@ -1659,6 +1659,11 @@ static void gaim_gtk_blist_drag_data_rcv_cb(GtkWidget *widget, GdkDragContext *dc, guint x, guint y, GtkSelectionData *sd, guint info, guint t) { + if (gtkblist->drag_timeout) { + g_source_remove(gtkblist->drag_timeout); + gtkblist->drag_timeout = 0; + } + if (sd->target == gdk_atom_intern("GAIM_BLIST_NODE", FALSE) && sd->data) { GaimBlistNode *n = NULL; GtkTreePath *path = NULL; Modified: branches/soc-2006-file-loggers/src/gtkconv.c =================================================================== --- branches/soc-2006-file-loggers/src/gtkconv.c 2006-06-24 12:04:32 UTC (rev 16329) +++ branches/soc-2006-file-loggers/src/gtkconv.c 2006-06-24 18:11:59 UTC (rev 16330) @@ -427,18 +427,14 @@ } static void -send_history_add(GaimConversation *conv, const char *message) +send_history_add(GaimGtkConversation *gtkconv, const char *message) { GList *first; - first = g_list_first(conv->send_history); - - if (first->data) - g_free(first->data); - + first = g_list_first(gtkconv->send_history); + g_free(first->data); first->data = g_strdup(message); - - conv->send_history = g_list_prepend(first, NULL); + gtkconv->send_history = g_list_prepend(first, NULL); } static gboolean @@ -462,7 +458,7 @@ GtkTextIter end; send_history = gtk_imhtml_get_markup(GTK_IMHTML(gtkconv->entry)); - send_history_add(conv, send_history); + send_history_add(gtkconv, send_history); g_free(send_history); cmdline = cmd + strlen(prefix); @@ -562,7 +558,7 @@ bufs = gtk_imhtml_get_markup_lines(GTK_IMHTML(gtkconv->entry)); for (i = 0; bufs[i]; i++) { - send_history_add(conv, bufs[i]); + send_history_add(gtkconv, bufs[i]); if (gaim_conversation_get_type(conv) == GAIM_CONV_TYPE_IM) gaim_conv_im_send_with_flags(GAIM_CONV_IM(conv), bufs[i], flags); else if (gaim_conversation_get_type(conv) == GAIM_CONV_TYPE_CHAT) @@ -572,7 +568,7 @@ g_strfreev(bufs); } else { - send_history_add(conv, buf); + send_history_add(gtkconv, buf); if (gaim_conversation_get_type(conv) == GAIM_CONV_TYPE_IM) gaim_conv_im_send_with_flags(GAIM_CONV_IM(conv), buf, flags); else if (gaim_conversation_get_type(conv) == GAIM_CONV_TYPE_CHAT) @@ -1787,29 +1783,28 @@ if (event->state & GDK_CONTROL_MASK) { switch (event->keyval) { case GDK_Up: - if (!conv->send_history) + if (!gtkconv->send_history) break; - if (!conv->send_history->prev) { + if (!gtkconv->send_history->prev) { GtkTextIter start, end; - if (conv->send_history->data) - g_free(conv->send_history->data); + g_free(gtkconv->send_history->data); gtk_text_buffer_get_start_iter(gtkconv->entry_buffer, &start); gtk_text_buffer_get_end_iter(gtkconv->entry_buffer, &end); - conv->send_history->data = + gtkconv->send_history->data = gtk_imhtml_get_markup(GTK_IMHTML(gtkconv->entry)); } - if (conv->send_history->next && conv->send_history->next->data) { + if (gtkconv->send_history->next && gtkconv->send_history->next->data) { GObject *object; GtkTextIter iter; GtkTextBuffer *buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(gtkconv->entry)); - conv->send_history = conv->send_history->next; + gtkconv->send_history = gtkconv->send_history->next; /* Block the signal to prevent application of default formatting. */ object = g_object_ref(G_OBJECT(gtkconv->entry)); @@ -1824,7 +1819,7 @@ gtk_imhtml_clear(GTK_IMHTML(gtkconv->entry)); gtk_imhtml_append_text_with_images( - GTK_IMHTML(gtkconv->entry), conv->send_history->data, + GTK_IMHTML(gtkconv->entry), gtkconv->send_history->data, 0, NULL); /* this is mainly just a hack so the formatting at the * cursor gets picked up. */ @@ -1836,15 +1831,15 @@ break; case GDK_Down: - if (!conv->send_history) + if (!gtkconv->send_history) break; - if (conv->send_history->prev && conv->send_history->prev->data) { + if (gtkconv->send_history->prev && gtkconv->send_history->prev->data) { GObject *object; GtkTextIter iter; GtkTextBuffer *buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(gtkconv->entry)); - conv->send_history = conv->send_history->prev; + gtkconv->send_history = gtkconv->send_history->prev; /* Block the signal to prevent application of default formatting. */ object = g_object_ref(G_OBJECT(gtkconv->entry)); @@ -1859,11 +1854,11 @@ gtk_imhtml_clear(GTK_IMHTML(gtkconv->entry)); gtk_imhtml_append_text_with_images( - GTK_IMHTML(gtkconv->entry), conv->send_history->data, + GTK_IMHTML(gtkconv->entry), gtkconv->send_history->data, 0, NULL); /* this is mainly just a hack so the formatting at the * cursor gets picked up. */ - if (*(char *)conv->send_history->data) { + if (*(char *)gtkconv->send_history->data) { gtk_text_buffer_get_end_iter(buffer, &iter); gtk_text_buffer_move_mark_by_name(buffer, "insert", &iter); } else { @@ -2173,8 +2168,7 @@ if (gtk_text_iter_is_start(start_pos) && gtk_text_iter_is_end(end_pos)) { /* We deleted all the text, so turn off typing. */ - if (gaim_conv_im_get_type_again_timeout(im)) - gaim_conv_im_stop_type_again_timeout(im); + gaim_conv_im_stop_send_typed_timeout(im); serv_send_typing(gaim_conversation_get_gc(conv), gaim_conversation_get_name(conv), @@ -2918,22 +2912,18 @@ im = GAIM_CONV_IM(conv); - if (gaim_conv_im_get_type_again_timeout(im)) - gaim_conv_im_stop_type_again_timeout(im); + gaim_conv_im_stop_send_typed_timeout(im); + gaim_conv_im_start_send_typed_timeout(im); - gaim_conv_im_start_type_again_timeout(im); - + /* Check if we need to send another GAIM_TYPING message */ if (first || (gaim_conv_im_get_type_again(im) != 0 && - time(NULL) > gaim_conv_im_get_type_again(im))) { - - int timeout = serv_send_typing(gaim_conversation_get_gc(conv), - (char *)gaim_conversation_get_name(conv), - GAIM_TYPING); - - if (timeout) - gaim_conv_im_set_type_again(im, time(NULL) + timeout); - else - gaim_conv_im_set_type_again(im, 0); + time(NULL) > gaim_conv_im_get_type_again(im))) + { + unsigned int timeout; + timeout = serv_send_typing(gaim_conversation_get_gc(conv), + gaim_conversation_get_name(conv), + GAIM_TYPING); + gaim_conv_im_set_type_again(im, timeout); } } @@ -4347,6 +4337,7 @@ conv->ui_data = gtkconv; gtkconv->active_conv = conv; gtkconv->convs = g_list_prepend(gtkconv->convs, conv); + gtkconv->send_history = g_list_append(NULL, NULL); /* Setup some initial variables. */ gtkconv->sg = gtk_size_group_new(GTK_SIZE_GROUP_BOTH); @@ -4515,6 +4506,10 @@ gtk_object_sink(GTK_OBJECT(gtkconv->tooltips)); + gtkconv->send_history = g_list_first(gtkconv->send_history); + g_list_foreach(gtkconv->send_history, (GFunc)g_free, NULL); + g_list_free(gtkconv->send_history); + g_free(gtkconv); } Modified: branches/soc-2006-file-loggers/src/gtkconv.h =================================================================== --- branches/soc-2006-file-loggers/src/gtkconv.h 2006-06-24 12:04:32 UTC (rev 16329) +++ branches/soc-2006-file-loggers/src/gtkconv.h 2006-06-24 18:11:59 UTC (rev 16330) @@ -114,6 +114,7 @@ { GaimConversation *active_conv; GList *convs; + GList *send_history; GaimGtkWindow *win; Modified: branches/soc-2006-file-loggers/src/gtkmain.c =================================================================== --- branches/soc-2006-file-loggers/src/gtkmain.c 2006-06-24 12:04:32 UTC (rev 16329) +++ branches/soc-2006-file-loggers/src/gtkmain.c 2006-06-24 18:11:59 UTC (rev 16330) @@ -432,6 +432,7 @@ char *opt_session_arg = NULL; int dologin_ret = -1; char *search_path; + GList *accounts; #ifdef HAVE_SIGNAL_H int sig_indx; /* for setting up signal catching */ sigset_t sigset; @@ -752,10 +753,14 @@ gaim_accounts_restore_current_statuses(); } - if (gaim_accounts_get_all_active() == NULL) + if ((accounts = gaim_accounts_get_all_active()) == NULL) { gaim_gtk_accounts_window_show(); } + else + { + g_list_free(accounts); + } #ifdef HAVE_STARTUP_NOTIFICATION startup_notification_complete(); Modified: branches/soc-2006-file-loggers/src/gtkpounce.c =================================================================== --- branches/soc-2006-file-loggers/src/gtkpounce.c 2006-06-24 12:04:32 UTC (rev 16329) +++ branches/soc-2006-file-loggers/src/gtkpounce.c 2006-06-24 18:11:59 UTC (rev 16330) @@ -81,6 +81,7 @@ GtkWidget *idle; GtkWidget *idle_return; GtkWidget *typing; + GtkWidget *typed; GtkWidget *stop_typing; GtkWidget *message_recv; @@ -278,6 +279,9 @@ if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->typing))) events |= GAIM_POUNCE_TYPING; + if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->typed))) + events |= GAIM_POUNCE_TYPED; + if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->stop_typing))) events |= GAIM_POUNCE_TYPING_STOPPED; @@ -564,7 +568,7 @@ /* Create the "Pounce When Buddy..." frame. */ frame = gaim_gtk_make_frame(vbox2, _("Pounce When Buddy...")); - table = gtk_table_new(2, 4, FALSE); + table = gtk_table_new(5, 2, FALSE); gtk_container_add(GTK_CONTAINER(frame), table); gtk_table_set_col_spacings(GTK_TABLE(table), GAIM_HIG_BORDER); gtk_widget_show(table); @@ -583,29 +587,33 @@ gtk_check_button_new_with_mnemonic(_("Is no longer i_dle")); dialog->typing = gtk_check_button_new_with_mnemonic(_("Starts _typing")); + dialog->typed = + gtk_check_button_new_with_mnemonic(_("P_auses while typing")); dialog->stop_typing = gtk_check_button_new_with_mnemonic(_("Stops t_yping")); dialog->message_recv = gtk_check_button_new_with_mnemonic(_("Sends a _message")); - gtk_table_attach(GTK_TABLE(table), dialog->signon, 0, 1, 0, 1, + gtk_table_attach(GTK_TABLE(table), dialog->message_recv, 0, 1, 0, 1, GTK_FILL, 0, 0, 0); - gtk_table_attach(GTK_TABLE(table), dialog->signoff, 1, 2, 0, 1, + gtk_table_attach(GTK_TABLE(table), dialog->signon, 0, 1, 1, 2, GTK_FILL, 0, 0, 0); - gtk_table_attach(GTK_TABLE(table), dialog->away, 0, 1, 1, 2, + gtk_table_attach(GTK_TABLE(table), dialog->signoff, 0, 1, 2, 3, GTK_FILL, 0, 0, 0); - gtk_table_attach(GTK_TABLE(table), dialog->away_return, 1, 2, 1, 2, + gtk_table_attach(GTK_TABLE(table), dialog->away, 0, 1, 3, 4, GTK_FILL, 0, 0, 0); - gtk_table_attach(GTK_TABLE(table), dialog->idle, 0, 1, 2, 3, + gtk_table_attach(GTK_TABLE(table), dialog->away_return, 0, 1, 4, 5, GTK_FILL, 0, 0, 0); - gtk_table_attach(GTK_TABLE(table), dialog->idle_return, 1, 2, 2, 3, + gtk_table_attach(GTK_TABLE(table), dialog->idle, 1, 2, 0, 1, GTK_FILL, 0, 0, 0); - gtk_table_attach(GTK_TABLE(table), dialog->typing, 0, 1, 3, 4, + gtk_table_attach(GTK_TABLE(table), dialog->idle_return, 1, 2, 1, 2, GTK_FILL, 0, 0, 0); - gtk_table_attach(GTK_TABLE(table), dialog->stop_typing, 1, 2, 3, 4, + gtk_table_attach(GTK_TABLE(table), dialog->typing, 1, 2, 2, 3, GTK_FILL, 0, 0, 0); - gtk_table_attach(GTK_TABLE(table), dialog->message_recv, 0, 1, 4, 5, + gtk_table_attach(GTK_TABLE(table), dialog->typed, 1, 2, 3, 4, GTK_FILL, 0, 0, 0); + gtk_table_attach(GTK_TABLE(table), dialog->stop_typing, 1, 2, 4, 5, + GTK_FILL, 0, 0, 0); gtk_widget_show(dialog->signon); gtk_widget_show(dialog->signoff); @@ -614,6 +622,7 @@ gtk_widget_show(dialog->idle); gtk_widget_show(dialog->idle_return); gtk_widget_show(dialog->typing); + gtk_widget_show(dialog->typed); gtk_widget_show(dialog->stop_typing); gtk_widget_show(dialog->message_recv); @@ -845,6 +854,8 @@ (events & GAIM_POUNCE_IDLE_RETURN)); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->typing), (events & GAIM_POUNCE_TYPING)); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->typed), + (events & GAIM_POUNCE_TYPED)); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->stop_typing), (events & GAIM_POUNCE_TYPING_STOPPED)); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->message_recv), @@ -1429,6 +1440,8 @@ tmp = g_strdup_printf( (events & GAIM_POUNCE_TYPING) ? _("%s has started typing to you (%s)") : + (events & GAIM_POUNCE_TYPED) ? + _("%s has paused while typing to you (%s)") : (events & GAIM_POUNCE_SIGNON) ? _("%s has signed on (%s)") : (events & GAIM_POUNCE_IDLE_RETURN) ? Modified: branches/soc-2006-file-loggers/src/gtksavedstatuses.c =================================================================== --- branches/soc-2006-file-loggers/src/gtksavedstatuses.c 2006-06-24 12:04:32 UTC (rev 16329) +++ branches/soc-2006-file-loggers/src/gtksavedstatuses.c 2006-06-24 18:11:59 UTC (rev 16330) @@ -760,6 +760,10 @@ type = gaim_account_get_status_type(account, id); gaim_savedstatus_set_substatus(saved_status, account, type, message); } + else + { + gaim_savedstatus_unset_substatus(saved_status, account); + } g_free(id); g_free(message); } while (gtk_tree_model_iter_next(model, &iter)); Modified: branches/soc-2006-file-loggers/src/gtkstatusbox.c =================================================================== --- branches/soc-2006-file-loggers/src/gtkstatusbox.c 2006-06-24 12:04:32 UTC (rev 16329) +++ branches/soc-2006-file-loggers/src/gtkstatusbox.c 2006-06-24 18:11:59 UTC (rev 16330) @@ -744,7 +744,11 @@ { g_source_remove(status_box->typing); status_box->typing = 0; - status_menu_refresh_iter(status_box); + if (status_box->account != NULL) + update_to_reflect_account_status(status_box, status_box->account, + gaim_account_get_active_status(status_box->account)); + else + status_menu_refresh_iter(status_box); return TRUE; } Modified: branches/soc-2006-file-loggers/src/pounce.c =================================================================== --- branches/soc-2006-file-loggers/src/pounce.c 2006-06-24 12:04:32 UTC (rev 16329) +++ branches/soc-2006-file-loggers/src/pounce.c 2006-06-24 18:11:59 UTC (rev 16330) @@ -206,6 +206,8 @@ add_event_to_xmlnode(child, "return-from-idle"); if (events & GAIM_POUNCE_TYPING) add_event_to_xmlnode(child, "start-typing"); + if (events & GAIM_POUNCE_TYPED) + add_event_to_xmlnode(child, "typed"); if (events & GAIM_POUNCE_TYPING_STOPPED) add_event_to_xmlnode(child, "stop-typing"); if (events & GAIM_POUNCE_MESSAGE_RECEIVED) @@ -411,7 +413,7 @@ else if (!strcmp(element_name, "option")) { if (!strcmp(data->option_type, "on-away")) data->options |= GAIM_POUNCE_OPTION_AWAY; - + g_free(data->option_type); data->option_type = NULL; } @@ -430,6 +432,8 @@ data->events |= GAIM_POUNCE_IDLE_RETURN; else if (!strcmp(data->event_type, "start-typing")) data->events |= GAIM_POUNCE_TYPING; + else if (!strcmp(data->event_type, "typed")) + data->events |= GAIM_POUNCE_TYPED; else if (!strcmp(data->event_type, "stop-typing")) data->events |= GAIM_POUNCE_TYPING_STOPPED; else if (!strcmp(data->event_type, "message-received")) @@ -1059,10 +1063,16 @@ conv = gaim_find_conversation_with_account(GAIM_CONV_TYPE_IM, name, account); if (conv != NULL) { + GaimTypingState state; GaimPounceEvent event; - event = (gaim_conv_im_get_typing_state(GAIM_CONV_IM(conv)) == GAIM_TYPING - ? GAIM_POUNCE_TYPING : GAIM_POUNCE_TYPING_STOPPED); + state = gaim_conv_im_get_typing_state(GAIM_CONV_IM(conv)); + if (state == GAIM_TYPED) + event = GAIM_POUNCE_TYPED; + else if (state == GAIM_NOT_TYPING) + event = GAIM_POUNCE_TYPING_STOPPED; + else + event = GAIM_POUNCE_TYPING; gaim_pounce_execute(account, name, event); } @@ -1105,6 +1115,8 @@ gaim_signal_connect(conv_handle, "buddy-typing", handle, GAIM_CALLBACK(buddy_typing_cb), NULL); + gaim_signal_connect(conv_handle, "buddy-typed", + handle, GAIM_CALLBACK(buddy_typing_cb), NULL); gaim_signal_connect(conv_handle, "buddy-typing-stopped", handle, GAIM_CALLBACK(buddy_typing_cb), NULL); Modified: branches/soc-2006-file-loggers/src/pounce.h =================================================================== --- branches/soc-2006-file-loggers/src/pounce.h 2006-06-24 12:04:32 UTC (rev 16329) +++ branches/soc-2006-file-loggers/src/pounce.h 2006-06-24 18:11:59 UTC (rev 16330) @@ -35,16 +35,17 @@ */ typedef enum { - GAIM_POUNCE_NONE = 0x00, /**< No events. */ - GAIM_POUNCE_SIGNON = 0x01, /**< The buddy signed on. */ - GAIM_POUNCE_SIGNOFF = 0x02, /**< The buddy signed off. */ - GAIM_POUNCE_AWAY = 0x04, /**< The buddy went away. */ - GAIM_POUNCE_AWAY_RETURN = 0x08, /**< The buddy returned from away. */ - GAIM_POUNCE_IDLE = 0x10, /**< The buddy became idle. */ - GAIM_POUNCE_IDLE_RETURN = 0x20, /**< The buddy is no longer idle. */ - GAIM_POUNCE_TYPING = 0x40, /**< The buddy started typing. */ - GAIM_POUNCE_TYPING_STOPPED = 0x80, /**< The buddy stopped typing. */ - GAIM_POUNCE_MESSAGE_RECEIVED = 0x100 /**< The buddy sent a message */ + GAIM_POUNCE_NONE = 0x000, /**< No events. */ + GAIM_POUNCE_SIGNON = 0x001, /**< The buddy signed on. */ + GAIM_POUNCE_SIGNOFF = 0x002, /**< The buddy signed off. */ + GAIM_POUNCE_AWAY = 0x004, /**< The buddy went away. */ + GAIM_POUNCE_AWAY_RETURN = 0x008, /**< The buddy returned from away. */ + GAIM_POUNCE_IDLE = 0x010, /**< The buddy became idle. */ + GAIM_POUNCE_IDLE_RETURN = 0x020, /**< The buddy is no longer idle. */ + GAIM_POUNCE_TYPING = 0x040, /**< The buddy started typing. */ + GAIM_POUNCE_TYPED = 0x080, /**< The buddy has entered text. */ + GAIM_POUNCE_TYPING_STOPPED = 0x100, /**< The buddy stopped typing. */ + GAIM_POUNCE_MESSAGE_RECEIVED = 0x200 /**< The buddy sent a message */ } GaimPounceEvent; Modified: branches/soc-2006-file-loggers/src/protocols/irc/cmds.c =================================================================== --- branches/soc-2006-file-loggers/src/protocols/irc/cmds.c 2006-06-24 12:04:32 UTC (rev 16329) +++ branches/soc-2006-file-loggers/src/protocols/irc/cmds.c 2006-06-24 18:11:59 UTC (rev 16330) @@ -372,6 +372,8 @@ g_free(buf); irc->quitting = TRUE; + + gaim_account_set_status(irc->account, "offline", TRUE, NULL); } return 0; Modified: branches/soc-2006-file-loggers/src/protocols/jabber/message.c =================================================================== --- branches/soc-2006-file-loggers/src/protocols/jabber/message.c 2006-06-24 12:04:32 UTC (rev 16329) +++ branches/soc-2006-file-loggers/src/protocols/jabber/message.c 2006-06-24 18:11:59 UTC (rev 16330) @@ -589,7 +589,7 @@ return 1; } -int jabber_send_typing(GaimConnection *gc, const char *who, int typing) +unsigned int jabber_send_typing(GaimConnection *gc, const char *who, GaimTypingState state) { JabberMessage *jm; JabberBuddy *jb; @@ -611,9 +611,9 @@ jm->to = g_strdup(who); jm->id = jabber_get_next_id(jm->js); - if(GAIM_TYPING == typing) + if(GAIM_TYPING == state) jm->chat_state = JM_STATE_COMPOSING; - else if(GAIM_TYPED == typing) + else if(GAIM_TYPED == state) jm->chat_state = JM_STATE_PAUSED; else jm->chat_state = JM_STATE_ACTIVE; Modified: branches/soc-2006-file-loggers/src/protocols/jabber/message.h =================================================================== --- branches/soc-2006-file-loggers/src/protocols/jabber/message.h 2006-06-24 12:04:32 UTC (rev 16329) +++ branches/soc-2006-file-loggers/src/protocols/jabber/message.h 2006-06-24 18:11:59 UTC (rev 16330) @@ -71,7 +71,7 @@ GaimMessageFlags flags); int jabber_message_send_chat(GaimConnection *gc, int id, const char *message, GaimMessageFlags flags); -int jabber_send_typing(GaimConnection *gc, const char *who, int typing); +unsigned int jabber_send_typing(GaimConnection *gc, const char *who, GaimTypingState state); #endif /* _GAIM_JABBER_MESSAGE_H_ */ Modified: branches/soc-2006-file-loggers/src/protocols/msn/msn.c =================================================================== --- branches/soc-2006-file-loggers/src/protocols/msn/msn.c 2006-06-24 12:04:32 UTC (rev 16329) +++ branches/soc-2006-file-loggers/src/protocols/msn/msn.c 2006-06-24 18:11:59 UTC (rev 16330) @@ -836,8 +836,8 @@ return 1; } -static int -msn_send_typing(GaimConnection *gc, const char *who, int typing) +static unsigned int +msn_send_typing(GaimConnection *gc, const char *who, GaimTypingState state) { GaimAccount *account; MsnSession *session; @@ -847,7 +847,12 @@ account = gaim_connection_get_account(gc); session = gc->proto_data; - if (!typing) + /* + * TODO: I feel like this should be "if (state != GAIM_TYPING)" + * but this is how it was before, and I don't want to break + * anything. --KingAnt + */ + if (state == GAIM_NOT_TYPING) return 0; if (!g_ascii_strcasecmp(who, gaim_account_get_username(account))) Modified: branches/soc-2006-file-loggers/src/protocols/novell/novell.c =================================================================== --- branches/soc-2006-file-loggers/src/protocols/novell/novell.c 2006-06-24 12:04:32 UTC (rev 16329) +++ branches/soc-2006-file-loggers/src/protocols/novell/novell.c 2006-06-24 18:11:59 UTC (rev 16330) @@ -2303,8 +2303,8 @@ return 1; } -static int -novell_send_typing(GaimConnection * gc, const char *name, int typing) +static unsigned int +novell_send_typing(GaimConnection * gc, const char *name, GaimTypingState state) { NMConference *conf = NULL; NMUser *user; @@ -2312,11 +2312,11 @@ NMERR_T rc = NM_OK; if (gc == NULL || name == NULL) - return -1; + return 0; user = gc->proto_data; if (user == NULL) - return -1; + return 0; /* Need to get the DN for the buddy so we can look up the convo */ dn = nm_lookup_dn(user, name); @@ -2327,7 +2327,7 @@ if (conf) { rc = nm_send_typing(user, conf, - ((typing == GAIM_TYPING) ? TRUE : FALSE), NULL); + ((state == GAIM_TYPING) ? TRUE : FALSE), NULL); _check_for_disconnect(user, rc); } Modified: branches/soc-2006-file-loggers/src/protocols/oscar/oscar.c =================================================================== --- branches/soc-2006-file-loggers/src/protocols/oscar/oscar.c 2006-06-24 12:04:32 UTC (rev 16329) +++ branches/soc-2006-file-loggers/src/protocols/oscar/oscar.c 2006-06-24 18:11:59 UTC (rev 16330) @@ -1113,9 +1113,8 @@ od->iconconnecting = FALSE; - if (od->icontimer) - gaim_timeout_remove(od->icontimer); - od->icontimer = gaim_timeout_add(100, gaim_icon_timerfunc, gc); + if (od->icontimer == 0) + od->icontimer = gaim_timeout_add(100, gaim_icon_timerfunc, gc); } static int @@ -1815,9 +1814,8 @@ cur = cur->next; if (!cur) { od->requesticon = g_slist_append(od->requesticon, g_strdup(gaim_normalize(account, info->sn))); - if (od->icontimer) - gaim_timeout_remove(od->icontimer); - od->icontimer = gaim_timeout_add(500, gaim_icon_timerfunc, gc); + if (od->icontimer == 0) + od->icontimer = gaim_timeout_add(500, gaim_icon_timerfunc, gc); } } g_free(b16); @@ -3169,9 +3167,8 @@ od->requesticon = g_slist_remove(od->requesticon, sn); g_free(sn); - if (od->icontimer) - gaim_timeout_remove(od->icontimer); - od->icontimer = gaim_timeout_add(500, gaim_icon_timerfunc, gc); + if (od->icontimer == 0) + od->icontimer = gaim_timeout_add(500, gaim_icon_timerfunc, gc); return 1; } @@ -3221,9 +3218,8 @@ cur = cur->next; } - if (od->icontimer) - gaim_timeout_remove(od->icontimer); - od->icontimer = gaim_timeout_add(250, gaim_icon_timerfunc, gc); + if (od->icontimer == 0) + od->icontimer = gaim_timeout_add(250, gaim_icon_timerfunc, gc); return 1; } @@ -3234,6 +3230,8 @@ aim_userinfo_t *userinfo; FlapConnection *conn; + od->icontimer = 0; + conn = flap_connection_getbytype(od, SNAC_FAMILY_BART); if (!conn) { if (!od->iconconnecting) { @@ -3286,7 +3284,9 @@ g_free(sn); } - return TRUE; + od->icontimer = gaim_timeout_add(100, gaim_icon_timerfunc, gc); + + return FALSE; } /* @@ -3945,8 +3945,8 @@ flap_connection_send_keepalive(od, conn); } -static int -oscar_send_typing(GaimConnection *gc, const char *name, int typing) +static unsigned int +oscar_send_typing(GaimConnection *gc, const char *name, GaimTypingState state) { OscarData *od; PeerConnection *conn; @@ -3956,7 +3956,7 @@ if ((conn != NULL) && (conn->ready)) { - peer_odc_send_typing(conn, typing); + peer_odc_send_typing(conn, state); } else { /* Don't send if this turkey is in our deny list */ @@ -3965,9 +3965,9 @@ if (!list) { struct buddyinfo *bi = g_hash_table_lookup(od->buddyinfo, gaim_normalize(gc->account, name)); if (bi && bi->typingnot) { - if (typing == GAIM_TYPING) + if (state == GAIM_TYPING) aim_im_sendmtn(od, 0x0001, name, 0x0002); - else if (typing == GAIM_TYPED) + else if (state == GAIM_TYPED) aim_im_sendmtn(od, 0x0001, name, 0x0001); else aim_im_sendmtn(od, 0x0001, name, 0x0000); Modified: branches/soc-2006-file-loggers/src/protocols/sametime/sametime.c =================================================================== --- branches/soc-2006-file-loggers/src/protocols/sametime/sametime.c 2006-06-24 12:04:32 UTC (rev 16329) +++ branches/soc-2006-file-loggers/src/protocols/sametime/sametime.c 2006-06-24 18:11:59 UTC (rev 16330) @@ -3965,14 +3965,14 @@ } -static int mw_prpl_send_typing(GaimConnection *gc, const char *name, - int typing) { +static unsigned int mw_prpl_send_typing(GaimConnection *gc, const char *name, + GaimTypingState state) { struct mwGaimPluginData *pd; struct mwIdBlock who = { (char *) name, NULL }; struct mwConversation *conv; - gpointer t = GINT_TO_POINTER(!! typing); + gpointer t = GINT_TO_POINTER(!! state); g_return_val_if_fail(gc != NULL, 0); pd = gc->proto_data; @@ -3984,7 +3984,7 @@ if(mwConversation_isOpen(conv)) return ! mwConversation_send(conv, mwImSend_TYPING, t); - if(typing) { + if ((state == GAIM_TYPING) || (state == GAIM_TYPED)) { /* let's only open a channel for typing, not for not-typing. Otherwise two users in psychic mode will continually open conversations to each other, never able to get rid of them, as @@ -3996,6 +3996,11 @@ mwConversation_open(conv); } + /* + * TODO: This should probably be "0." When it's set to 1, the Gaim + * core will call serv_send_typing(gc, who, GAIM_TYPING) once + * every second until the Gaim user stops typing. --KingAnt + */ return 1; } Modified: branches/soc-2006-file-loggers/src/protocols/simple/simple.c =================================================================== --- branches/soc-2006-file-loggers/src/protocols/simple/simple.c 2006-06-24 12:04:32 UTC (rev 16329) +++ branches/soc-2006-file-loggers/src/protocols/simple/simple.c 2006-06-24 18:11:59 UTC (rev 16330) @@ -1053,7 +1053,7 @@ send_sip_response(sip->gc, msg, 200, "OK", NULL); } -static int simple_typing(GaimConnection *gc, const char *name, int typing) { +static unsigned int simple_typing(GaimConnection *gc, const char *name, GaimTypingState state) { struct simple_account_data *sip = gc->proto_data; gchar *xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" @@ -1065,16 +1065,22 @@ "<refresh>60</refresh>\n" "</isComposing>"; gchar *recv = g_strdup(name); - if(typing == GAIM_TYPING) { + if(state == GAIM_TYPING) { gchar *msg = g_strdup_printf(xml, "active"); simple_send_message(sip, recv, msg, "application/im-iscomposing+xml"); g_free(msg); - } else { + } else /* TODO: Only if (state == GAIM_TYPED) ? */ { gchar *msg = g_strdup_printf(xml, "idle"); simple_send_message(sip, recv, msg, "application/im-iscomposing+xml"); g_free(msg); } g_free(recv); + /* + * TODO: Is this right? It will cause the core to call + * serv_send_typing(gc, who, GAIM_TYPING) once every second + * until the user stops typing. If that's not desired, + * then return 0 instead. + */ return 1; } Modified: branches/soc-2006-file-loggers/src/protocols/yahoo/yahoo.c =================================================================== --- branches/soc-2006-file-loggers/src/protocols/yahoo/yahoo.c 2006-06-24 12:04:32 UTC (rev 16329) +++ branches/soc-2006-file-loggers/src/protocols/yahoo/yahoo.c 2006-06-24 18:11:59 UTC (rev 16330) @@ -670,6 +670,7 @@ static void yahoo_process_message(GaimConnection *gc, struct yahoo_packet *pkt) { + struct yahoo_data *yd = gc->proto_data; GSList *l = pkt->hash; GSList *list = NULL; struct _yahoo_im *im = NULL; @@ -712,24 +713,29 @@ /** TODO: It seems that this check should be per IM, not global */ /* Check for the Doodle IMV */ - if(im != NULL && imv != NULL && !strcmp(imv, "doodle;11")) + if (im != NULL && imv!= NULL && im->from != NULL) { - GaimWhiteboard *wb; + g_hash_table_replace(yd->imvironments, g_strdup(im->from), g_strdup(imv)); - if (!yahoo_privacy_check(gc, im->from)) { - gaim_debug_info("yahoo", "Doodle request from %s dropped.\n", im->from); - return; - } + if (strcmp(imv, "doodle;11") == 0) + { + GaimWhiteboard *wb; - wb = gaim_whiteboard_get_session(gc->account, im->from); + if (!yahoo_privacy_check(gc, im->from)) { + gaim_debug_info("yahoo", "Doodle request from %s dropped.\n", im->from); + return; + } - /* If a Doodle session doesn't exist between this user */ - if(wb == NULL) - { - wb = gaim_whiteboard_create(gc->account, im->from, DOODLE_STATE_REQUESTED); + wb = gaim_whiteboard_get_session(gc->account, im->from); - yahoo_doodle_command_send_request(gc, im->from); - yahoo_doodle_command_send_ready(gc, im->from); + /* If a Doodle session doesn't exist between this user */ + if(wb == NULL) + { + wb = gaim_whiteboard_create(gc->account, im->from, DOODLE_STATE_REQUESTED); + + yahoo_doodle_command_send_request(gc, im->from); + yahoo_doodle_command_send_ready(gc, im->from); + } } } @@ -2576,6 +2582,7 @@ /* TODO: Is there a good grow size for the buffer? */ yd->txbuf = gaim_circ_buffer_new(0); yd->friends = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, yahoo_friend_free); + yd->imvironments = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free); yd->confs = NULL; yd->conf_id = 2; @@ -2628,6 +2635,7 @@ yahoo_c_leave(gc, 1); /* 1 = YAHOO_CHAT_ID */ g_hash_table_destroy(yd->friends); + g_hash_table_destroy(yd->imvironments); g_free(yd->chat_name); g_free(yd->cookie_y); @@ -3101,14 +3109,30 @@ yahoo_packet_hash_str(pkt, 97, "1"); yahoo_packet_hash_str(pkt, 14, msg2); - /* If this message is to a user who is also Doodling with the local user, + /* + * IMVironment. + * + * If this message is to a user who is also Doodling with the local user, * format the chat packet with the correct IMV information (thanks Yahoo!) - */ - wb = gaim_whiteboard_get_session(gc->account, (char*)who); + * + * Otherwise attempt to use the same IMVironment as the remote user, + * just so that we don't inadvertantly reset their IMVironment back + * to nothing. + * + * If they have no set an IMVironment, then use the default.... [truncated message content] |