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: <the...@us...> - 2006-08-15 08:59:56
|
Revision: 16770 Author: thekingant Date: 2006-08-15 01:59:55 -0700 (Tue, 15 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16770&view=rev Log Message: ----------- Remove libao-devel and audiofile-devel from our RPM SPEC file and add gtreamer-devel Modified Paths: -------------- branches/v2_0_0/gaim.spec.in Modified: branches/v2_0_0/gaim.spec.in =================================================================== --- branches/v2_0_0/gaim.spec.in 2006-08-15 08:59:11 UTC (rev 16769) +++ branches/v2_0_0/gaim.spec.in 2006-08-15 08:59:55 UTC (rev 16770) @@ -27,7 +27,7 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-root # Generic build requirements -BuildRequires: libtool, pkgconfig, libao-devel, audiofile-devel, intltool, gettext +BuildRequires: libtool, pkgconfig, intltool, gettext, gstreamer-devel %{?_with_avahi:BuildRequires: avahi-compat-howl avahi-compat-howl-devel} %{?_with_howl:BuildRequires: howl-devel} %{?_with_silc:BuildRequires: /usr/include/silc/silcclient.h} @@ -323,9 +323,13 @@ %endif %changelog +* Tue Aug 15 2006 <the...@us...> +- Add a BuildRequire for gstreamer-devel +- Remove the BuildRequires for audiofile-devel and libao-devel + * Mon May 8 2006 <the...@us...> - Add --with avahi option to compile the gaim-bonjour package against - Avahi's Howl compatibility layer. + Avahi's Howl compatibility layer * Wed Mar 29 2006 <st...@no...> - Source RPM uses tar.bz2 now to save space This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <the...@us...> - 2006-08-15 08:59:15
|
Revision: 16769 Author: thekingant Date: 2006-08-15 01:59:11 -0700 (Tue, 15 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16769&view=rev Log Message: ----------- I'm not really sure why I removed gettext Modified Paths: -------------- trunk/gaim.spec.in Modified: trunk/gaim.spec.in =================================================================== --- trunk/gaim.spec.in 2006-08-15 08:47:44 UTC (rev 16768) +++ trunk/gaim.spec.in 2006-08-15 08:59:11 UTC (rev 16769) @@ -27,7 +27,7 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-root # Generic build requirements -BuildRequires: libtool, pkgconfig, intltool, gstreamer-devel +BuildRequires: libtool, pkgconfig, intltool, gettext, gstreamer-devel %{?_with_avahi:BuildRequires: avahi-compat-howl avahi-compat-howl-devel} %{?_with_howl:BuildRequires: howl-devel} %{?_with_silc:BuildRequires: /usr/include/silc/silcclient.h} @@ -325,8 +325,7 @@ %changelog * Tue Aug 15 2006 <the...@us...> - Add a BuildRequire for gstreamer-devel -- Remove the BuildRequires for audiofile-devel, libao-devel and - gettext +- Remove the BuildRequires for audiofile-devel and libao-devel * Mon May 8 2006 <the...@us...> - Add --with avahi option to compile the gaim-bonjour package against This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <the...@us...> - 2006-08-15 08:54:16
|
Revision: 16768 Author: thekingant Date: 2006-08-15 01:47:44 -0700 (Tue, 15 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16768&view=rev Log Message: ----------- Add gstreamer-devel and remove libao-devel, audiofile-devel and gettext from our RPM spec Good? Modified Paths: -------------- trunk/gaim.spec.in Modified: trunk/gaim.spec.in =================================================================== --- trunk/gaim.spec.in 2006-08-15 08:26:12 UTC (rev 16767) +++ trunk/gaim.spec.in 2006-08-15 08:47:44 UTC (rev 16768) @@ -27,7 +27,7 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-root # Generic build requirements -BuildRequires: libtool, pkgconfig, libao-devel, audiofile-devel, intltool, gettext +BuildRequires: libtool, pkgconfig, intltool, gstreamer-devel %{?_with_avahi:BuildRequires: avahi-compat-howl avahi-compat-howl-devel} %{?_with_howl:BuildRequires: howl-devel} %{?_with_silc:BuildRequires: /usr/include/silc/silcclient.h} @@ -323,9 +323,14 @@ %endif %changelog +* Tue Aug 15 2006 <the...@us...> +- Add a BuildRequire for gstreamer-devel +- Remove the BuildRequires for audiofile-devel, libao-devel and + gettext + * Mon May 8 2006 <the...@us...> - Add --with avahi option to compile the gaim-bonjour package against - Avahi's Howl compatibility layer. + Avahi's Howl compatibility layer * Wed Mar 29 2006 <st...@no...> - Source RPM uses tar.bz2 now to save space This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <the...@us...> - 2006-08-15 08:26:25
|
Revision: 16767 Author: thekingant Date: 2006-08-15 01:26:12 -0700 (Tue, 15 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16767&view=rev Log Message: ----------- Backport my changes that will hopefully fix idle-away stuff Modified Paths: -------------- branches/v2_0_0/src/connection.h branches/v2_0_0/src/gtkstatusbox.c branches/v2_0_0/src/idle.c branches/v2_0_0/src/savedstatuses.c branches/v2_0_0/src/savedstatuses.h Modified: branches/v2_0_0/src/connection.h =================================================================== --- branches/v2_0_0/src/connection.h 2006-08-15 08:22:29 UTC (rev 16766) +++ branches/v2_0_0/src/connection.h 2006-08-15 08:26:12 UTC (rev 16767) @@ -89,8 +89,6 @@ guint keepalive; /**< Keep-alive. */ - gboolean is_auto_away; /**< Whether or not it's auto-away. */ - gboolean wants_to_die; /**< Wants to Die state. This is set when the user chooses to log out, or when the protocol is Modified: branches/v2_0_0/src/gtkstatusbox.c =================================================================== --- branches/v2_0_0/src/gtkstatusbox.c 2006-08-15 08:22:29 UTC (rev 16766) +++ branches/v2_0_0/src/gtkstatusbox.c 2006-08-15 08:26:12 UTC (rev 16767) @@ -257,6 +257,7 @@ statusbox, GAIM_CALLBACK(account_status_changed_cb)); statusbox->status_changed_signal = 0; } + gaim_signals_disconnect_by_handle(statusbox); gaim_prefs_disconnect_by_handle(statusbox); G_OBJECT_CLASS(parent_class)->finalize(obj); @@ -825,8 +826,7 @@ } static void -current_status_pref_changed_cb(const char *name, GaimPrefType type, - gconstpointer val, gpointer data) +current_savedstatus_changed_cb(GaimSavedStatus *now, GaimSavedStatus *old, gpointer data) { GtkGaimStatusBox *status_box = data; @@ -996,8 +996,10 @@ gtk_gaim_status_box_regenerate(status_box); gtk_gaim_status_box_refresh(status_box); - gaim_prefs_connect_callback(status_box, "/core/savedstatus/current", - current_status_pref_changed_cb, status_box); + gaim_signal_connect(gaim_savedstatuses_get_handle(), "savedstatus-changed", + status_box, + GAIM_CALLBACK(current_savedstatus_changed_cb), + status_box); gaim_prefs_connect_callback(status_box, "/gaim/gtk/blist/show_buddy_icons", buddy_list_details_pref_changed_cb, status_box); gaim_prefs_connect_callback(status_box, "/gaim/gtk/conversations/spellcheck", @@ -1249,9 +1251,8 @@ * "Saved..." or a popular status then do nothing. * Popular statuses are * activated elsewhere, and we update the status_box - * accordingly by monitoring the preference - * "/core/savedstatus/current" and then calling - * status_menu_refresh_iter() + * accordingly by connecting to the savedstatus-changed + * signal and then calling status_menu_refresh_iter() */ if (type != GTK_GAIM_STATUS_BOX_TYPE_PRIMITIVE) return; Modified: branches/v2_0_0/src/idle.c =================================================================== --- branches/v2_0_0/src/idle.c 2006-08-15 08:22:29 UTC (rev 16766) +++ branches/v2_0_0/src/idle.c 2006-08-15 08:26:12 UTC (rev 16767) @@ -58,63 +58,6 @@ static time_t last_active_time = 0; static void -set_account_autoaway(GaimConnection *gc) -{ - GaimAccount *account; - GaimPresence *presence; - GaimStatus *status; - - if (gc->is_auto_away) - /* This account is already auto-away! */ - return; - - account = gaim_connection_get_account(gc); - presence = gaim_account_get_presence(account); - status = gaim_presence_get_active_status(presence); - - if (gaim_status_is_available(status)) - { - GaimSavedStatus *saved_status; - - gaim_debug_info("idle", "Making %s auto-away\n", - gaim_account_get_username(account)); - - saved_status = gaim_savedstatus_get_idleaway(); - gaim_savedstatus_activate_for_account(saved_status, account); - - gc->is_auto_away = GAIM_IDLE_AUTO_AWAY; - } else { - gc->is_auto_away = GAIM_IDLE_AWAY_BUT_NOT_AUTO_AWAY; - } -} - -static void -unset_account_autoaway(GaimConnection *gc) -{ - GaimAccount *account; - GaimSavedStatus *saved_status; - - account = gaim_connection_get_account(gc); - - if (!gc->is_auto_away) - /* This account is already not auto-away! */ - return; - - if (gc->is_auto_away == GAIM_IDLE_AWAY_BUT_NOT_AUTO_AWAY) { - gc->is_auto_away = GAIM_IDLE_NOT_AWAY; - } else { - gc->is_auto_away = GAIM_IDLE_NOT_AWAY; - - gaim_debug_info("idle", "%s returning from auto-away\n", - gaim_account_get_username(account)); - - /* Return our account to its previous status */ - saved_status = gaim_savedstatus_get_current(); - gaim_savedstatus_activate_for_account(saved_status, account); - } -} - -static void set_account_idle(GaimAccount *account, int time_idle) { GaimPresence *presence; @@ -203,13 +146,11 @@ if (auto_away && (time_idle > (60 * gaim_prefs_get_int("/core/away/mins_before_away")))) { - for (l = gaim_connections_get_all(); l != NULL; l = l->next) - set_account_autoaway(l->data); + gaim_savedstatus_set_idleaway(TRUE); } else if (time_idle < 60 * gaim_prefs_get_int("/core/away/mins_before_away")) { - for (l = gaim_connections_get_all(); l != NULL; l = l->next) - unset_account_autoaway(l->data); + gaim_savedstatus_set_idleaway(FALSE); } /* Idle reporting stuff */ @@ -239,12 +180,19 @@ } static void +signing_on_cb(GaimConnection *gc, void *data) +{ + /* When signing on a new account, check if the account should be idle */ + check_idleness(); +} + +static void signing_off_cb(GaimConnection *gc, void *data) { GaimAccount *account; account = gaim_connection_get_account(gc); - idled_accts = g_list_remove(idled_accts, account); + set_account_unidle(account); } void @@ -288,6 +236,9 @@ gaim_signal_connect(gaim_conversations_get_handle(), "sent-im-msg", gaim_idle_get_handle(), GAIM_CALLBACK(im_msg_sent_cb), NULL); + gaim_signal_connect(gaim_connections_get_handle(), "signing-on", + gaim_idle_get_handle(), + GAIM_CALLBACK(signing_on_cb), NULL); gaim_signal_connect(gaim_connections_get_handle(), "signing-off", gaim_idle_get_handle(), GAIM_CALLBACK(signing_off_cb), NULL); Modified: branches/v2_0_0/src/savedstatuses.c =================================================================== --- branches/v2_0_0/src/savedstatuses.c 2006-08-15 08:22:29 UTC (rev 16766) +++ branches/v2_0_0/src/savedstatuses.c 2006-08-15 08:26:12 UTC (rev 16767) @@ -25,6 +25,7 @@ #include "internal.h" #include "debug.h" +#include "idle.h" #include "notify.h" #include "savedstatuses.h" #include "dbus-maybe.h" @@ -676,9 +677,9 @@ * If we just deleted our current status or our idleaway status, * then set the appropriate pref back to 0. */ - current = gaim_prefs_get_int("/core/savedstatus/current"); + current = gaim_prefs_get_int("/core/savedstatus/default"); if (current == creation_time) - gaim_prefs_set_int("/core/savedstatus/current", 0); + gaim_prefs_set_int("/core/savedstatus/default", 0); idleaway = gaim_prefs_get_int("/core/savedstatus/idleaway"); if (idleaway == creation_time) @@ -725,12 +726,21 @@ } GaimSavedStatus * -gaim_savedstatus_get_current() +gaim_savedstatus_get_current(void) { + if (gaim_savedstatus_is_idleaway()) + return gaim_savedstatus_get_idleaway(); + else + return gaim_savedstatus_get_default(); +} + +GaimSavedStatus * +gaim_savedstatus_get_default() +{ int creation_time; GaimSavedStatus *saved_status = NULL; - creation_time = gaim_prefs_get_int("/core/savedstatus/current"); + creation_time = gaim_prefs_get_int("/core/savedstatus/default"); if (creation_time != 0) saved_status = g_hash_table_lookup(creation_times, &creation_time); @@ -744,7 +754,7 @@ * using? In any case, add a default status. */ saved_status = gaim_savedstatus_new(NULL, GAIM_STATUS_AVAILABLE); - gaim_prefs_set_int("/core/savedstatus/current", + gaim_prefs_set_int("/core/savedstatus/default", gaim_savedstatus_get_creation_time(saved_status)); } @@ -780,6 +790,51 @@ return saved_status; } +gboolean +gaim_savedstatus_is_idleaway() +{ + return gaim_prefs_get_bool("/core/savedstatus/isidleaway"); +} + +void +gaim_savedstatus_set_idleaway(gboolean idleaway) +{ + GList *accounts, *node; + GaimSavedStatus *old, *saved_status; + + if (gaim_savedstatus_is_idleaway() == idleaway) + /* Don't need to do anything */ + return; + + /* Changing our status makes us un-idle */ + if (!idleaway) + gaim_idle_touch(); + + old = gaim_savedstatus_get_current(); + gaim_prefs_set_bool("/core/savedstatus/isidleaway", idleaway); + saved_status = gaim_savedstatus_get_current(); + + accounts = gaim_accounts_get_all_active(); + for (node = accounts; node != NULL; node = node->next) + { + GaimAccount *account; + GaimPresence *presence; + GaimStatus *status; + + account = node->data; + presence = gaim_account_get_presence(account); + status = gaim_presence_get_active_status(presence); + + if (!idleaway || gaim_status_is_available(status)) + gaim_savedstatus_activate_for_account(saved_status, account); + } + + g_list_free(accounts); + + gaim_signal_emit(gaim_savedstatuses_get_handle(), "savedstatus-changed", + saved_status, old); +} + GaimSavedStatus * gaim_savedstatus_get_startup() { @@ -1001,12 +1056,12 @@ g_list_free(accounts); - gaim_prefs_set_int("/core/savedstatus/current", + gaim_prefs_set_int("/core/savedstatus/default", gaim_savedstatus_get_creation_time(saved_status)); + gaim_savedstatus_set_idleaway(FALSE); gaim_signal_emit(gaim_savedstatuses_get_handle(), "savedstatus-changed", saved_status, old); - } void @@ -1070,10 +1125,11 @@ * saved status and return that to the user. */ gaim_prefs_add_none("/core/savedstatus"); - gaim_prefs_add_int("/core/savedstatus/current", 0); + gaim_prefs_add_int("/core/savedstatus/default", 0); gaim_prefs_add_int("/core/savedstatus/startup", 0); gaim_prefs_add_bool("/core/savedstatus/startup_current_status", TRUE); gaim_prefs_add_int("/core/savedstatus/idleaway", 0); + gaim_prefs_add_bool("/core/savedstatus/isidleaway", FALSE); load_statuses(); Modified: branches/v2_0_0/src/savedstatuses.h =================================================================== --- branches/v2_0_0/src/savedstatuses.h 2006-08-15 08:22:29 UTC (rev 16766) +++ branches/v2_0_0/src/savedstatuses.h 2006-08-15 08:26:12 UTC (rev 16767) @@ -171,7 +171,9 @@ GList *gaim_savedstatuses_get_popular(unsigned int how_many); /** - * Returns the currently selected saved status. + * Returns the currently selected saved status. If we are idle + * then this returns gaim_savedstatus_get_idleaway(). Otherwise + * it returns gaim_savedstatus_get_default(). * * @return A pointer to the in-use GaimSavedStatus. * This function never returns NULL. @@ -179,7 +181,16 @@ GaimSavedStatus *gaim_savedstatus_get_current(void); /** - * Returns the saved status that gets used when your + * Returns the default saved status that is used when our + * accounts are not idle-away. + * + * @return A pointer to the in-use GaimSavedStatus. + * This function never returns NULL. + */ +GaimSavedStatus *gaim_savedstatus_get_default(void); + +/** + * Returns the saved status that is used when your * accounts become idle-away. * * @return A pointer to the idle-away GaimSavedStatus. @@ -188,6 +199,23 @@ GaimSavedStatus *gaim_savedstatus_get_idleaway(void); /** + * Return TRUE if we are currently idle-away. Otherwise + * returns FALSE. + * + * @return TRUE if our accounts have been set to idle-away. + */ +gboolean gaim_savedstatus_is_idleaway(void); + +/** + * Set whether accounts in Gaim are idle-away or not. + * + * @param TRUE if accounts should be switched to use the + * idle-away saved status. FALSE if they should + * be switched to use the default status. + */ +void gaim_savedstatus_set_idleaway(gboolean idleaway); + +/** * Returns the status to be used when gaim is starting up * * @return A pointer to the startup GaimSavedStatus. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <the...@us...> - 2006-08-15 08:22:33
|
Revision: 16766 Author: thekingant Date: 2006-08-15 01:22:29 -0700 (Tue, 15 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16766&view=rev Log Message: ----------- I'm hoping this will fix a lot of the remaining idle-away problems, like not correctly returning from idle-away. This change also causes the gtkstatusbox to show your idle-away status when you are idle-away. Please test everything and let me know if there are any problems. Modified Paths: -------------- trunk/src/connection.h trunk/src/gtkstatusbox.c trunk/src/idle.c trunk/src/savedstatuses.c trunk/src/savedstatuses.h Modified: trunk/src/connection.h =================================================================== --- trunk/src/connection.h 2006-08-15 07:23:13 UTC (rev 16765) +++ trunk/src/connection.h 2006-08-15 08:22:29 UTC (rev 16766) @@ -89,8 +89,6 @@ guint keepalive; /**< Keep-alive. */ - gboolean is_auto_away; /**< Whether or not it's auto-away. */ - gboolean wants_to_die; /**< Wants to Die state. This is set when the user chooses to log out, or when the protocol is Modified: trunk/src/gtkstatusbox.c =================================================================== --- trunk/src/gtkstatusbox.c 2006-08-15 07:23:13 UTC (rev 16765) +++ trunk/src/gtkstatusbox.c 2006-08-15 08:22:29 UTC (rev 16766) @@ -257,6 +257,7 @@ statusbox, GAIM_CALLBACK(account_status_changed_cb)); statusbox->status_changed_signal = 0; } + gaim_signals_disconnect_by_handle(statusbox); gaim_prefs_disconnect_by_handle(statusbox); G_OBJECT_CLASS(parent_class)->finalize(obj); @@ -829,8 +830,7 @@ } static void -current_status_pref_changed_cb(const char *name, GaimPrefType type, - gconstpointer val, gpointer data) +current_savedstatus_changed_cb(GaimSavedStatus *now, GaimSavedStatus *old, gpointer data) { GtkGaimStatusBox *status_box = data; @@ -1000,8 +1000,10 @@ gtk_gaim_status_box_regenerate(status_box); gtk_gaim_status_box_refresh(status_box); - gaim_prefs_connect_callback(status_box, "/core/savedstatus/current", - current_status_pref_changed_cb, status_box); + gaim_signal_connect(gaim_savedstatuses_get_handle(), "savedstatus-changed", + status_box, + GAIM_CALLBACK(current_savedstatus_changed_cb), + status_box); gaim_prefs_connect_callback(status_box, "/gaim/gtk/blist/show_buddy_icons", buddy_list_details_pref_changed_cb, status_box); gaim_prefs_connect_callback(status_box, "/gaim/gtk/conversations/spellcheck", @@ -1253,9 +1255,8 @@ * "Saved..." or a popular status then do nothing. * Popular statuses are * activated elsewhere, and we update the status_box - * accordingly by monitoring the preference - * "/core/savedstatus/current" and then calling - * status_menu_refresh_iter() + * accordingly by connecting to the savedstatus-changed + * signal and then calling status_menu_refresh_iter() */ if (type != GTK_GAIM_STATUS_BOX_TYPE_PRIMITIVE) return; Modified: trunk/src/idle.c =================================================================== --- trunk/src/idle.c 2006-08-15 07:23:13 UTC (rev 16765) +++ trunk/src/idle.c 2006-08-15 08:22:29 UTC (rev 16766) @@ -58,63 +58,6 @@ static time_t last_active_time = 0; static void -set_account_autoaway(GaimConnection *gc) -{ - GaimAccount *account; - GaimPresence *presence; - GaimStatus *status; - - if (gc->is_auto_away) - /* This account is already auto-away! */ - return; - - account = gaim_connection_get_account(gc); - presence = gaim_account_get_presence(account); - status = gaim_presence_get_active_status(presence); - - if (gaim_status_is_available(status)) - { - GaimSavedStatus *saved_status; - - gaim_debug_info("idle", "Making %s auto-away\n", - gaim_account_get_username(account)); - - saved_status = gaim_savedstatus_get_idleaway(); - gaim_savedstatus_activate_for_account(saved_status, account); - - gc->is_auto_away = GAIM_IDLE_AUTO_AWAY; - } else { - gc->is_auto_away = GAIM_IDLE_AWAY_BUT_NOT_AUTO_AWAY; - } -} - -static void -unset_account_autoaway(GaimConnection *gc) -{ - GaimAccount *account; - GaimSavedStatus *saved_status; - - account = gaim_connection_get_account(gc); - - if (!gc->is_auto_away) - /* This account is already not auto-away! */ - return; - - if (gc->is_auto_away == GAIM_IDLE_AWAY_BUT_NOT_AUTO_AWAY) { - gc->is_auto_away = GAIM_IDLE_NOT_AWAY; - } else { - gc->is_auto_away = GAIM_IDLE_NOT_AWAY; - - gaim_debug_info("idle", "%s returning from auto-away\n", - gaim_account_get_username(account)); - - /* Return our account to its previous status */ - saved_status = gaim_savedstatus_get_current(); - gaim_savedstatus_activate_for_account(saved_status, account); - } -} - -static void set_account_idle(GaimAccount *account, int time_idle) { GaimPresence *presence; @@ -203,13 +146,11 @@ if (auto_away && (time_idle > (60 * gaim_prefs_get_int("/core/away/mins_before_away")))) { - for (l = gaim_connections_get_all(); l != NULL; l = l->next) - set_account_autoaway(l->data); + gaim_savedstatus_set_idleaway(TRUE); } else if (time_idle < 60 * gaim_prefs_get_int("/core/away/mins_before_away")) { - for (l = gaim_connections_get_all(); l != NULL; l = l->next) - unset_account_autoaway(l->data); + gaim_savedstatus_set_idleaway(FALSE); } /* Idle reporting stuff */ @@ -252,7 +193,6 @@ account = gaim_connection_get_account(gc); set_account_unidle(account); - unset_account_autoaway(gc); } void Modified: trunk/src/savedstatuses.c =================================================================== --- trunk/src/savedstatuses.c 2006-08-15 07:23:13 UTC (rev 16765) +++ trunk/src/savedstatuses.c 2006-08-15 08:22:29 UTC (rev 16766) @@ -25,6 +25,7 @@ #include "internal.h" #include "debug.h" +#include "idle.h" #include "notify.h" #include "savedstatuses.h" #include "dbus-maybe.h" @@ -676,9 +677,9 @@ * If we just deleted our current status or our idleaway status, * then set the appropriate pref back to 0. */ - current = gaim_prefs_get_int("/core/savedstatus/current"); + current = gaim_prefs_get_int("/core/savedstatus/default"); if (current == creation_time) - gaim_prefs_set_int("/core/savedstatus/current", 0); + gaim_prefs_set_int("/core/savedstatus/default", 0); idleaway = gaim_prefs_get_int("/core/savedstatus/idleaway"); if (idleaway == creation_time) @@ -725,12 +726,21 @@ } GaimSavedStatus * -gaim_savedstatus_get_current() +gaim_savedstatus_get_current(void) { + if (gaim_savedstatus_is_idleaway()) + return gaim_savedstatus_get_idleaway(); + else + return gaim_savedstatus_get_default(); +} + +GaimSavedStatus * +gaim_savedstatus_get_default() +{ int creation_time; GaimSavedStatus *saved_status = NULL; - creation_time = gaim_prefs_get_int("/core/savedstatus/current"); + creation_time = gaim_prefs_get_int("/core/savedstatus/default"); if (creation_time != 0) saved_status = g_hash_table_lookup(creation_times, &creation_time); @@ -744,7 +754,7 @@ * using? In any case, add a default status. */ saved_status = gaim_savedstatus_new(NULL, GAIM_STATUS_AVAILABLE); - gaim_prefs_set_int("/core/savedstatus/current", + gaim_prefs_set_int("/core/savedstatus/default", gaim_savedstatus_get_creation_time(saved_status)); } @@ -780,6 +790,51 @@ return saved_status; } +gboolean +gaim_savedstatus_is_idleaway() +{ + return gaim_prefs_get_bool("/core/savedstatus/isidleaway"); +} + +void +gaim_savedstatus_set_idleaway(gboolean idleaway) +{ + GList *accounts, *node; + GaimSavedStatus *old, *saved_status; + + if (gaim_savedstatus_is_idleaway() == idleaway) + /* Don't need to do anything */ + return; + + /* Changing our status makes us un-idle */ + if (!idleaway) + gaim_idle_touch(); + + old = gaim_savedstatus_get_current(); + gaim_prefs_set_bool("/core/savedstatus/isidleaway", idleaway); + saved_status = gaim_savedstatus_get_current(); + + accounts = gaim_accounts_get_all_active(); + for (node = accounts; node != NULL; node = node->next) + { + GaimAccount *account; + GaimPresence *presence; + GaimStatus *status; + + account = node->data; + presence = gaim_account_get_presence(account); + status = gaim_presence_get_active_status(presence); + + if (!idleaway || gaim_status_is_available(status)) + gaim_savedstatus_activate_for_account(saved_status, account); + } + + g_list_free(accounts); + + gaim_signal_emit(gaim_savedstatuses_get_handle(), "savedstatus-changed", + saved_status, old); +} + GaimSavedStatus * gaim_savedstatus_get_startup() { @@ -1001,12 +1056,12 @@ g_list_free(accounts); - gaim_prefs_set_int("/core/savedstatus/current", + gaim_prefs_set_int("/core/savedstatus/default", gaim_savedstatus_get_creation_time(saved_status)); + gaim_savedstatus_set_idleaway(FALSE); gaim_signal_emit(gaim_savedstatuses_get_handle(), "savedstatus-changed", saved_status, old); - } void @@ -1070,10 +1125,11 @@ * saved status and return that to the user. */ gaim_prefs_add_none("/core/savedstatus"); - gaim_prefs_add_int("/core/savedstatus/current", 0); + gaim_prefs_add_int("/core/savedstatus/default", 0); gaim_prefs_add_int("/core/savedstatus/startup", 0); gaim_prefs_add_bool("/core/savedstatus/startup_current_status", TRUE); gaim_prefs_add_int("/core/savedstatus/idleaway", 0); + gaim_prefs_add_bool("/core/savedstatus/isidleaway", FALSE); load_statuses(); Modified: trunk/src/savedstatuses.h =================================================================== --- trunk/src/savedstatuses.h 2006-08-15 07:23:13 UTC (rev 16765) +++ trunk/src/savedstatuses.h 2006-08-15 08:22:29 UTC (rev 16766) @@ -171,7 +171,9 @@ GList *gaim_savedstatuses_get_popular(unsigned int how_many); /** - * Returns the currently selected saved status. + * Returns the currently selected saved status. If we are idle + * then this returns gaim_savedstatus_get_idleaway(). Otherwise + * it returns gaim_savedstatus_get_default(). * * @return A pointer to the in-use GaimSavedStatus. * This function never returns NULL. @@ -179,7 +181,16 @@ GaimSavedStatus *gaim_savedstatus_get_current(void); /** - * Returns the saved status that gets used when your + * Returns the default saved status that is used when our + * accounts are not idle-away. + * + * @return A pointer to the in-use GaimSavedStatus. + * This function never returns NULL. + */ +GaimSavedStatus *gaim_savedstatus_get_default(void); + +/** + * Returns the saved status that is used when your * accounts become idle-away. * * @return A pointer to the idle-away GaimSavedStatus. @@ -188,6 +199,23 @@ GaimSavedStatus *gaim_savedstatus_get_idleaway(void); /** + * Return TRUE if we are currently idle-away. Otherwise + * returns FALSE. + * + * @return TRUE if our accounts have been set to idle-away. + */ +gboolean gaim_savedstatus_is_idleaway(void); + +/** + * Set whether accounts in Gaim are idle-away or not. + * + * @param TRUE if accounts should be switched to use the + * idle-away saved status. FALSE if they should + * be switched to use the default status. + */ +void gaim_savedstatus_set_idleaway(gboolean idleaway); + +/** * Returns the status to be used when gaim is starting up * * @return A pointer to the startup GaimSavedStatus. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <the...@us...> - 2006-08-15 07:23:18
|
Revision: 16765 Author: thekingant Date: 2006-08-15 00:23:13 -0700 (Tue, 15 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16765&view=rev Log Message: ----------- A patch from Kevin Stange that should fix some idleness problems with MSN and Yahoo Modified Paths: -------------- trunk/src/idle.c Modified: trunk/src/idle.c =================================================================== --- trunk/src/idle.c 2006-08-15 06:21:39 UTC (rev 16764) +++ trunk/src/idle.c 2006-08-15 07:23:13 UTC (rev 16765) @@ -239,12 +239,20 @@ } static void +signing_on_cb(GaimConnection *gc, void *data) +{ + /* When signing on a new account, check if the account should be idle */ + check_idleness(); +} + +static void signing_off_cb(GaimConnection *gc, void *data) { GaimAccount *account; account = gaim_connection_get_account(gc); - idled_accts = g_list_remove(idled_accts, account); + set_account_unidle(account); + unset_account_autoaway(gc); } void @@ -288,6 +296,9 @@ gaim_signal_connect(gaim_conversations_get_handle(), "sent-im-msg", gaim_idle_get_handle(), GAIM_CALLBACK(im_msg_sent_cb), NULL); + gaim_signal_connect(gaim_connections_get_handle(), "signing-on", + gaim_idle_get_handle(), + GAIM_CALLBACK(signing_on_cb), NULL); gaim_signal_connect(gaim_connections_get_handle(), "signing-off", gaim_idle_get_handle(), GAIM_CALLBACK(signing_off_cb), NULL); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <sa...@us...> - 2006-08-15 06:22:03
|
Revision: 16764 Author: sadrul Date: 2006-08-14 23:21:39 -0700 (Mon, 14 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16764&view=rev Log Message: ----------- Add a savedstatus dialog, and a "status" command to bring it up. You an also select "Saved..." from the dropdown in the buddylist. The 'Add' and 'Edit' buttons don't do anything yet. They will probably get to work some time tomorrow. Modified Paths: -------------- trunk/console/Makefile trunk/console/gntblist.c trunk/console/gntconv.c trunk/console/libgnt/gnttree.c trunk/doc/gntgaim.1.in Added Paths: ----------- trunk/console/gntstatus.c trunk/console/gntstatus.h Modified: trunk/console/Makefile =================================================================== --- trunk/console/Makefile 2006-08-15 04:07:38 UTC (rev 16763) +++ trunk/console/Makefile 2006-08-15 06:21:39 UTC (rev 16764) @@ -13,6 +13,7 @@ gntplugin.c \ gntprefs.c \ gntrequest.c \ + gntstatus.c \ gntui.c GG_HEADERS = \ @@ -25,6 +26,7 @@ gntprefs.h \ gntplugin.h \ gntrequest.h \ + gntstatus.h \ gntui.h GG_OBJECTS = \ @@ -37,6 +39,7 @@ gntplugin.o \ gntprefs.o \ gntrequest.o \ + gntstatus.o \ gntui.o all: gntgaim Modified: trunk/console/gntblist.c =================================================================== --- trunk/console/gntblist.c 2006-08-15 04:07:38 UTC (rev 16763) +++ trunk/console/gntblist.c 2006-08-15 06:21:39 UTC (rev 16764) @@ -17,6 +17,7 @@ #include "gnttree.h" #include "gntblist.h" +#include "gntstatus.h" #include <string.h> #define PREF_ROOT "/gaim/gnt/blist" @@ -42,7 +43,8 @@ typedef enum { STATUS_PRIMITIVE = 0, - STATUS_SAVED + STATUS_SAVED_POPULAR, + STATUS_SAVED_ALL, } StatusType; typedef struct @@ -1035,6 +1037,7 @@ int i; GList *iter; GList *items = NULL; + StatusBoxItem *item = NULL; /* First the primitives */ GaimStatusPrimitive prims[] = {GAIM_STATUS_AVAILABLE, GAIM_STATUS_AWAY, @@ -1042,7 +1045,7 @@ for (i = 0; prims[i] != GAIM_STATUS_UNSET; i++) { - StatusBoxItem *item = g_new0(StatusBoxItem, 1); + item = g_new0(StatusBoxItem, 1); item->type = STATUS_PRIMITIVE; item->u.prim = prims[i]; items = g_list_prepend(items, item); @@ -1053,18 +1056,26 @@ /* Now the popular statuses */ for (iter = gaim_savedstatuses_get_popular(6); iter; iter = iter->next) { - StatusBoxItem *item = g_new0(StatusBoxItem, 1); - item->type = STATUS_SAVED; + item = g_new0(StatusBoxItem, 1); + item->type = STATUS_SAVED_POPULAR; item->u.saved = iter->data; items = g_list_prepend(items, item); gnt_combo_box_add_data(GNT_COMBO_BOX(ggblist->status), item, gaim_savedstatus_get_title(iter->data)); } + /* More savedstatuses */ + item = g_new0(StatusBoxItem, 1); + item->type = STATUS_SAVED_ALL; + items = g_list_prepend(items, item); + gnt_combo_box_add_data(GNT_COMBO_BOX(ggblist->status), item, + _("Saved...")); + /* The keys for the combobox are created here, and never used * anywhere else. So make sure the keys are freed when the widget * is destroyed. */ - g_object_set_data_full(G_OBJECT(ggblist->status), "list of statuses", items, (GDestroyNotify)destroy_status_list); + g_object_set_data_full(G_OBJECT(ggblist->status), "list of statuses", + items, (GDestroyNotify)destroy_status_list); } void gg_blist_init() @@ -1125,7 +1136,7 @@ status_selection_changed(GntComboBox *box, StatusBoxItem *old, StatusBoxItem *now, gpointer null) { gnt_entry_set_text(GNT_ENTRY(ggblist->statustext), NULL); - if (now->type == STATUS_SAVED) + if (now->type == STATUS_SAVED_POPULAR) { /* Set the status immediately */ gaim_savedstatus_activate(now->u.saved); @@ -1137,6 +1148,10 @@ gnt_box_move_focus(GNT_BOX(ggblist->window), 1); ggblist->typing = g_timeout_add(TYPING_TIMEOUT, (GSourceFunc)remove_typing_cb, NULL); } + else if (now->type == STATUS_SAVED_ALL) + { + gg_savedstatus_show_all(); + } else g_return_if_reached(); } Modified: trunk/console/gntconv.c =================================================================== --- trunk/console/gntconv.c 2006-08-15 04:07:38 UTC (rev 16763) +++ trunk/console/gntconv.c 2006-08-15 06:21:39 UTC (rev 16764) @@ -11,6 +11,7 @@ #include "gntdebug.h" #include "gntplugin.h" #include "gntprefs.h" +#include "gntstatus.h" #include "gnt.h" #include "gntbox.h" @@ -566,6 +567,9 @@ gaim_cmd_register("prefs", "", GAIM_CMD_P_DEFAULT, GAIM_CMD_FLAG_CHAT | GAIM_CMD_FLAG_IM, NULL, cmd_show_window, _("prefs: Show the preference window."), gg_prefs_show_all); + gaim_cmd_register("status", "", GAIM_CMD_P_DEFAULT, + GAIM_CMD_FLAG_CHAT | GAIM_CMD_FLAG_IM, NULL, + cmd_show_window, _("statuses: Show the savedstatuses window."), gg_savedstatus_show_all); } void gg_conversation_uninit() Added: trunk/console/gntstatus.c =================================================================== --- trunk/console/gntstatus.c (rev 0) +++ trunk/console/gntstatus.c 2006-08-15 06:21:39 UTC (rev 16764) @@ -0,0 +1,139 @@ +#include <gnt.h> +#include <gntbox.h> +#include <gntbutton.h> +#include <gntentry.h> +#include <gntlabel.h> +#include <gnttree.h> + +#include <request.h> + +#include "gntgaim.h" +#include "gntstatus.h" + +static struct +{ + GntWidget *window; + GntWidget *tree; +} statuses; + +static void +reset_status_window(GntWidget *widget, gpointer null) +{ + statuses.window = NULL; + statuses.tree = NULL; +} + +static void +populate_statuses(GntTree *tree) +{ + const GList *list; + + for (list = gaim_savedstatuses_get_all(); list; list = list->next) + { + GaimSavedStatus *saved = list->data; + const char *title, *type, *message; + + if (gaim_savedstatus_is_transient(saved)) + continue; + + title = gaim_savedstatus_get_title(saved); + type = gaim_primitive_get_name_from_type(gaim_savedstatus_get_type(saved)); + message = gaim_savedstatus_get_message(saved); /* XXX: Strip possible markups */ + + gnt_tree_add_row_last(tree, saved, + gnt_tree_create_row(tree, title, type, message), NULL); + } +} + +static void +really_delete_status(GaimSavedStatus *saved) +{ + /* XXX: Close any modify dialog opened for the savedstatus */ + if (statuses.tree) + gnt_tree_remove(GNT_TREE(statuses.tree), saved); + + gaim_savedstatus_delete(gaim_savedstatus_get_title(saved)); +} + +static void +ask_before_delete(GntWidget *button, gpointer null) +{ + char *ask; + GaimSavedStatus *saved; + + g_return_if_fail(statuses.tree != NULL); + + saved = gnt_tree_get_selection_data(GNT_TREE(statuses.tree)); + ask = g_strdup_printf(_("Are you sure you want to delete \"%s\""), + gaim_savedstatus_get_title(saved)); + + gaim_request_action(saved, _("Delete Status"), ask, NULL, 0, saved, 2, + _("Delete"), really_delete_status, _("Cancel"), NULL); + g_free(ask); +} + +static void +use_savedstatus_cb(GntWidget *widget, gpointer null) +{ + g_return_if_fail(statuses.tree != NULL); + + gaim_savedstatus_activate(gnt_tree_get_selection_data(GNT_TREE(statuses.tree))); +} + +void gg_savedstatus_show_all() +{ + GntWidget *window, *tree, *box, *button; + if (statuses.window) + return; + + statuses.window = window = gnt_vbox_new(FALSE); + gnt_box_set_toplevel(GNT_BOX(window), TRUE); + gnt_box_set_title(GNT_BOX(window), _("Saved Statuses")); + gnt_box_set_fill(GNT_BOX(window), FALSE); + gnt_box_set_alignment(GNT_BOX(window), GNT_ALIGN_MID); + gnt_box_set_pad(GNT_BOX(window), 0); + + /* XXX: Add some sorting function to sort alphabetically, perhaps */ + statuses.tree = tree = gnt_tree_new_with_columns(3); + gnt_tree_set_column_titles(GNT_TREE(tree), _("Title"), _("Type"), _("Message")); + gnt_tree_set_show_title(GNT_TREE(tree), TRUE); + gnt_tree_set_col_width(GNT_TREE(tree), 0, 25); + gnt_tree_set_col_width(GNT_TREE(tree), 1, 12); + gnt_tree_set_col_width(GNT_TREE(tree), 2, 35); + gnt_box_add_widget(GNT_BOX(window), tree); + + populate_statuses(GNT_TREE(tree)); + + box = gnt_hbox_new(FALSE); + gnt_box_add_widget(GNT_BOX(window), box); + + button = gnt_button_new(_("Use")); + gnt_box_add_widget(GNT_BOX(box), button); + g_signal_connect(G_OBJECT(button), "activate", + G_CALLBACK(use_savedstatus_cb), NULL); + + button = gnt_button_new(_("Add")); + gnt_box_add_widget(GNT_BOX(box), button); + + button = gnt_button_new(_("Edit")); + gnt_box_add_widget(GNT_BOX(box), button); + + button = gnt_button_new(_("Delete")); + gnt_box_add_widget(GNT_BOX(box), button); + g_signal_connect(G_OBJECT(button), "activate", + G_CALLBACK(ask_before_delete), NULL); + + button = gnt_button_new(_("Close")); + gnt_box_add_widget(GNT_BOX(box), button); + g_signal_connect_swapped(G_OBJECT(button), "activate", + G_CALLBACK(gnt_widget_destroy), window); + + g_signal_connect(G_OBJECT(window), "destroy", + G_CALLBACK(reset_status_window), NULL); + gnt_widget_show(window); +} + +void gg_savedstatus_edit(GaimSavedStatus *saved) +{ +} + Property changes on: trunk/console/gntstatus.c ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + native Added: trunk/console/gntstatus.h =================================================================== --- trunk/console/gntstatus.h (rev 0) +++ trunk/console/gntstatus.h 2006-08-15 06:21:39 UTC (rev 16764) @@ -0,0 +1,7 @@ +#include <status.h> +#include <savedstatuses.h> + +void gg_savedstatus_show_all(); + +void gg_savedstatus_edit(GaimSavedStatus *saved); + Property changes on: trunk/console/gntstatus.h ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + native Modified: trunk/console/libgnt/gnttree.c =================================================================== --- trunk/console/libgnt/gnttree.c 2006-08-15 04:07:38 UTC (rev 16763) +++ trunk/console/libgnt/gnttree.c 2006-08-15 06:21:39 UTC (rev 16764) @@ -274,7 +274,7 @@ int x = pos; mvwhline(widget->window, pos + 1, pos, ACS_HLINE | COLOR_PAIR(GNT_COLOR_NORMAL), - widget->priv.width - pos); + widget->priv.width - pos - 1); for (i = 0; i < tree->ncol; i++) { Modified: trunk/doc/gntgaim.1.in =================================================================== --- trunk/doc/gntgaim.1.in 2006-08-15 04:07:38 UTC (rev 16763) +++ trunk/doc/gntgaim.1.in 2006-08-15 06:21:39 UTC (rev 16764) @@ -169,6 +169,10 @@ .B prefs for the preferences window. +.TP +.B status +for the status window. + .SH BUGS Known bugs are listed at .br This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <sa...@us...> - 2006-08-15 04:07:56
|
Revision: 16763 Author: sadrul Date: 2006-08-14 21:07:38 -0700 (Mon, 14 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16763&view=rev Log Message: ----------- Redirect the debug messages to stderr when started with -d. Fix the order of the windows in the windowlist. Modified Paths: -------------- trunk/console/gntdebug.c trunk/console/libgnt/gntmain.c Modified: trunk/console/gntdebug.c =================================================================== --- trunk/console/gntdebug.c 2006-08-15 04:05:27 UTC (rev 16762) +++ trunk/console/gntdebug.c 2006-08-15 04:07:38 UTC (rev 16763) @@ -80,6 +80,12 @@ debug.window = debug.tview = NULL; } +static void +print_stderr(const char *string) +{ + g_printerr("%s", string); +} + void gg_debug_window_show() { if (debug.window == NULL) @@ -102,6 +108,7 @@ void gg_debug_init() { + g_set_print_handler(print_stderr); /* Redirect the debug messages to stderr */ if (gaim_debug_is_enabled()) gg_debug_window_show(); } Modified: trunk/console/libgnt/gntmain.c =================================================================== --- trunk/console/libgnt/gntmain.c 2006-08-15 04:05:27 UTC (rev 16762) +++ trunk/console/libgnt/gntmain.c 2006-08-15 04:07:38 UTC (rev 16763) @@ -273,8 +273,8 @@ { GntBox *box = GNT_BOX(iter->data); - gnt_tree_add_row_after(GNT_TREE(tree), box, - gnt_tree_create_row(GNT_TREE(tree), box->title), NULL, NULL); + gnt_tree_add_row_last(GNT_TREE(tree), box, + gnt_tree_create_row(GNT_TREE(tree), box->title), NULL); update_window_in_list(GNT_WIDGET(box)); } @@ -752,9 +752,9 @@ if ((GNT_IS_BOX(widget) && GNT_BOX(widget)->title) && window_list.window != widget && GNT_WIDGET_IS_FLAG_SET(widget, GNT_WIDGET_CAN_TAKE_FOCUS)) { - gnt_tree_add_row_after(GNT_TREE(window_list.tree), widget, + gnt_tree_add_row_last(GNT_TREE(window_list.tree), widget, gnt_tree_create_row(GNT_TREE(window_list.tree), GNT_BOX(widget)->title), - NULL, NULL); + NULL); update_window_in_list(widget); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <sa...@us...> - 2006-08-15 04:05:34
|
Revision: 16762 Author: sadrul Date: 2006-08-14 21:05:27 -0700 (Mon, 14 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16762&view=rev Log Message: ----------- Update the manpage for gntgaim to reflect that I think it's pretty pimpin'. Modified Paths: -------------- trunk/doc/gntgaim.1.in Modified: trunk/doc/gntgaim.1.in =================================================================== --- trunk/doc/gntgaim.1.in 2006-08-15 02:45:52 UTC (rev 16761) +++ trunk/doc/gntgaim.1.in 2006-08-15 04:05:27 UTC (rev 16762) @@ -21,7 +21,7 @@ .\" USA. .TH gntgaim 1 .SH NAME -GntGaim \- Console frontend for Instant Messaging client Gaim. +GntGaim \- A Pimpin' Penguin console frontend for Instant Messaging client Gaim. .SH SYNOPSIS .TP 5 \fBgntgaim \fI[options]\fR @@ -39,8 +39,9 @@ command line syntax: .TP .B \-d, \-\-debug -Print debugging messages to stdout. These are the same debugging messages -that are displayed in the \fBDebug\fR window. +Print debugging messages to stderr and start with the \fBDebug\fR window. The +messages shown in the \fBDebug\fR window are the same as the ones printed in +stderr. .TP .B \-c, \-\-config=\fIDIR\fB Use \fIDIR\fR as the directory for config files instead of \fI~/.gaim\fR. @@ -80,6 +81,18 @@ .B Alt \+ r Start resizing a window. Press the cursor keys to resize the window. When you are done, press \fBEnter\fR or \fBEscape\fR. +.TP +.B Alt \+ d +Dump the contents of the screen in HTML format in a file named "dump.html" in +working directory. +.TP +.B Alt \+ . +Move the position of the current window in the window list one place to the +right. +.TP +.B Alt \+ , +Move the position of the current window in the window list one place to the +left. .SH FILES \fI~/.gntrc\fR: configuration file for gnt applications. @@ -132,6 +145,30 @@ disabled = gray; black .br +.SH Conversation Commands +There are a few helpful commands in addition to the regular commands. You can +use these from any conversation to access other windows. + +.TP +.B accounts +for the accounts window. + +.TP +.B buddylist +for the buddylist. + +.TP +.B debugwin +for the debug window. + +.TP +.B plugins +for the plugins window. + +.TP +.B prefs +for the preferences window. + .SH BUGS Known bugs are listed at .br @@ -139,15 +176,15 @@ .SH PATCHES If you fix a bug in \fBgntgaim\fR (or otherwise enhance it), please submit a -patch (using \fIcvs diff -up > my.diff\fR against the latest CVS version) +patch (using \fIsvn diff > my.diff\fR against the latest SVN version) at .br \fIhttp://sourceforge.net/tracker/?func=add&group_id=235&atid=300235\fR Before sending a bug report, please verify that you have the latest -version of \fBgntgaim\fR. Many bugs (major and minor) are fixed -at each release, and if yours is out of date, the problem may already -have been solved. +version of \fBgntgaim\fR and \fBlibgaim\fR. Many bugs (major and minor) are +fixed at each release, and if yours is out of date, the problem may already have +been solved. .SH SEE ALSO \fIhttp://gaim.sourceforge.net/\fR @@ -173,5 +210,7 @@ Sadrul Habib Chowdhury <\fIs...@us...\fR> .br -This manpage was written by Sadrul Habib Chowdhury <\fIs...@us...\fR>. +This manpage was written by Sadrul Habib Chowdhury +<\fIs...@us...\fR> and Dennis Ristuccia +<\fId...@de...\fR>. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <sa...@us...> - 2006-08-15 02:46:55
|
Revision: 16761 Author: sadrul Date: 2006-08-14 19:45:52 -0700 (Mon, 14 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16761&view=rev Log Message: ----------- Show scrollbars in trees and textviews. Modified Paths: -------------- trunk/console/libgnt/gntmain.c trunk/console/libgnt/gnttextview.c trunk/console/libgnt/gnttree.c trunk/console/libgnt/test/multiwin.c Modified: trunk/console/libgnt/gntmain.c =================================================================== --- trunk/console/libgnt/gntmain.c 2006-08-14 21:48:08 UTC (rev 16760) +++ trunk/console/libgnt/gntmain.c 2006-08-15 02:45:52 UTC (rev 16761) @@ -403,6 +403,8 @@ ch = '^'; break; case '.': ch = 'v'; break; + case 'a': + ch = '#'; break; default: ch = ' '; break; } Modified: trunk/console/libgnt/gnttextview.c =================================================================== --- trunk/console/libgnt/gnttextview.c 2006-08-14 21:48:08 UTC (rev 16760) +++ trunk/console/libgnt/gnttextview.c 2006-08-15 02:45:52 UTC (rev 16761) @@ -26,6 +26,7 @@ GntTextView *view = GNT_TEXT_VIEW(widget); int i = 0; GList *lines; + int showing, position, rows, scrcol; werase(widget->window); @@ -45,19 +46,36 @@ whline(widget->window, ' ' | seg->flags, widget->priv.width - line->length - 1); } } - - mvwaddch(widget->window, 0, - widget->priv.width - 1, - lines ? - ACS_UARROW | COLOR_PAIR(GNT_COLOR_HIGHLIGHT_D) : - ' '| COLOR_PAIR(GNT_COLOR_NORMAL)); - mvwaddch(widget->window, widget->priv.height - 1, - widget->priv.width - 1, - (view->list && view->list->prev) ? - ACS_DARROW | COLOR_PAIR(GNT_COLOR_HIGHLIGHT_D) : - ' '| COLOR_PAIR(GNT_COLOR_NORMAL)); + scrcol = widget->priv.width - 1; + rows = widget->priv.height - 2; + if (rows > 0) + { + showing = rows * rows / g_list_length(g_list_first(view->list)) + 1; + showing = MIN(rows, showing); + + position = showing * g_list_length(view->list) / rows; + position = MAX((lines != NULL), position); + + if (showing + position > rows) + position = rows - showing; + + if (showing + position == rows && view->list && view->list->prev) + position = MAX(1, rows - 1 - showing); + else if (showing + position < rows && view->list && !view->list->prev) + position = rows - showing; + + mvwvline(widget->window, position + 1, scrcol, + ACS_CKBOARD | COLOR_PAIR(GNT_COLOR_HIGHLIGHT_D), showing); + } + + mvwaddch(widget->window, 0, scrcol, + (lines ? ACS_UARROW : ' ') | COLOR_PAIR(GNT_COLOR_HIGHLIGHT_D)); + mvwaddch(widget->window, widget->priv.height - 1, scrcol, + ((view->list && view->list->prev) ? ACS_DARROW : ' ') | + COLOR_PAIR(GNT_COLOR_HIGHLIGHT_D)); + DEBUG; } @@ -133,7 +151,7 @@ GNT_WIDGET_SET_FLAGS(GNT_WIDGET(instance), GNT_WIDGET_GROW_Y); widget->priv.minw = 5; - widget->priv.minh = 1; + widget->priv.minh = 2; DEBUG; } Modified: trunk/console/libgnt/gnttree.c =================================================================== --- trunk/console/libgnt/gnttree.c 2006-08-14 21:48:08 UTC (rev 16760) +++ trunk/console/libgnt/gnttree.c 2006-08-15 02:45:52 UTC (rev 16761) @@ -246,10 +246,11 @@ static void redraw_tree(GntTree *tree) { - int start; + int start, i; GntWidget *widget = GNT_WIDGET(tree); GntTreeRow *row; - int pos, up, down, nr; + int pos, up, down; + int showing, position, rows, scrcol; if (!GNT_WIDGET_IS_FLAG_SET(GNT_WIDGET(tree), GNT_WIDGET_MAPPED)) return; @@ -273,7 +274,7 @@ int x = pos; mvwhline(widget->window, pos + 1, pos, ACS_HLINE | COLOR_PAIR(GNT_COLOR_NORMAL), - widget->priv.width - pos - 1); + widget->priv.width - pos); for (i = 0; i < tree->ncol; i++) { @@ -291,11 +292,11 @@ start = 2; } - nr = widget->priv.height - pos * 2 - start - 1; - tree->bottom = get_next_n_opt(tree->top, nr, &down); - if (down < nr) + rows = widget->priv.height - pos * 2 - start - 1; + tree->bottom = get_next_n_opt(tree->top, rows, &down); + if (down < rows) { - tree->top = get_prev_n(tree->bottom, nr); + tree->top = get_prev_n(tree->bottom, rows); if (tree->top == NULL) tree->top = tree->root; } @@ -304,17 +305,11 @@ if (up < 0) tree->top = tree->current; else if (up >= widget->priv.height - pos) - tree->top = get_prev_n(tree->current, nr); + tree->top = get_prev_n(tree->current, rows); - mvwaddch(widget->window, start + pos, - widget->priv.width - pos - 1, - (tree->top != tree->root) ? - ACS_UARROW | COLOR_PAIR(GNT_COLOR_HIGHLIGHT_D) : - ' '| COLOR_PAIR(GNT_COLOR_NORMAL)); - row = tree->top; - for (start = start + pos; row && start < widget->priv.height - pos; - start++, row = get_next(row)) + for (i = start + pos; row && i < widget->priv.height - pos; + i++, row = get_next(row)) { char *str; int wr; @@ -356,28 +351,56 @@ } wbkgdset(widget->window, '\0' | attr); - mvwprintw(widget->window, start, pos, str); + mvwprintw(widget->window, i, pos, str); whline(widget->window, ' ', widget->priv.width - pos * 2 - g_utf8_strlen(str, -1) - 1); tree->bottom = row; g_free(str); - tree_mark_columns(tree, pos, start, ACS_VLINE | attr); + tree_mark_columns(tree, pos, i, ACS_VLINE | attr); } - mvwaddch(widget->window, widget->priv.height - pos - 1, - widget->priv.width - pos - 1, - get_next(tree->bottom) ? - ACS_DARROW | COLOR_PAIR(GNT_COLOR_HIGHLIGHT_D) : - ' '| COLOR_PAIR(GNT_COLOR_NORMAL)); - wbkgdset(widget->window, '\0' | COLOR_PAIR(GNT_COLOR_NORMAL)); - while (start < widget->priv.height - pos) + while (i < widget->priv.height - pos) { - mvwhline(widget->window, start, pos, ' ', + mvwhline(widget->window, i, pos, ' ', widget->priv.width - pos * 2 - 1); - tree_mark_columns(tree, pos, start, ACS_VLINE); - start++; + tree_mark_columns(tree, pos, i, ACS_VLINE); + i++; } + scrcol = widget->priv.width - pos - 1; + rows--; + if (rows > 0) + { + get_next_n_opt(tree->root, g_list_length(tree->list), &i); + showing = rows * rows / MAX(i, 1) + 1; + showing = MIN(rows, showing); + + position = showing * get_distance(tree->root, tree->top) / rows; + position = MAX((tree->top != tree->root), position); + + if (showing + position > rows) + position = rows - showing; + + if (showing + position == rows && row) + position = MAX(0, rows - 1 - showing); + else if (showing + position < rows && !row) + position = rows - showing; + + position += pos + start + 1; + + mvwvline(widget->window, pos + start + 1, scrcol, + ' ' | COLOR_PAIR(GNT_COLOR_NORMAL), rows); + mvwvline(widget->window, position, scrcol, + ACS_CKBOARD | COLOR_PAIR(GNT_COLOR_HIGHLIGHT_D), showing); + } + + mvwaddch(widget->window, start + pos, scrcol, + ((tree->top != tree->root) ? ACS_UARROW : ' ') | + COLOR_PAIR(GNT_COLOR_HIGHLIGHT_D)); + + mvwaddch(widget->window, widget->priv.height - pos - 1, scrcol, + (row ? ACS_DARROW : ' ') | COLOR_PAIR(GNT_COLOR_HIGHLIGHT_D)); + gnt_widget_queue_update(widget); } @@ -550,7 +573,7 @@ GntWidget *widget = GNT_WIDGET(instance); GNT_WIDGET_SET_FLAGS(widget, GNT_WIDGET_GROW_X | GNT_WIDGET_GROW_Y); widget->priv.minw = 4; - widget->priv.minh = 3; + widget->priv.minh = 4; DEBUG; } @@ -1007,7 +1030,7 @@ va_start(args, tree); for (i = 0; i < tree->ncol; i++) { - list = g_list_append(list, va_arg(args, const char *)); + list = g_list_append(list, va_arg(args, char *)); } va_end(args); @@ -1041,6 +1064,7 @@ void gnt_tree_set_show_title(GntTree *tree, gboolean set) { tree->show_title = set; + GNT_WIDGET(tree)->priv.minh = (set ? 6 : 4); } void gnt_tree_set_compare_func(GntTree *tree, GCompareFunc func) Modified: trunk/console/libgnt/test/multiwin.c =================================================================== --- trunk/console/libgnt/test/multiwin.c 2006-08-14 21:48:08 UTC (rev 16760) +++ trunk/console/libgnt/test/multiwin.c 2006-08-15 02:45:52 UTC (rev 16761) @@ -62,6 +62,14 @@ gnt_tree_add_row_after(GNT_TREE(tree), "6", gnt_tree_create_row(GNT_TREE(tree), "6", " long text", "a2"), "4", NULL); + int i; + for (i = 110; i < 130; i++) + { + char *s; + s = g_strdup_printf("%d", i); /* XXX: yes, leaking */ + gnt_tree_add_row_after(GNT_TREE(tree), s, gnt_tree_create_row(GNT_TREE(tree), s, " long text", "a2"), "4", NULL); + } + gnt_tree_set_row_flags(GNT_TREE(tree), "e", GNT_TEXT_FLAG_DIM); gnt_tree_set_selected(GNT_TREE(tree), "2"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <ebl...@us...> - 2006-08-14 21:48:15
|
Revision: 16760 Author: eblanton Date: 2006-08-14 14:48:08 -0700 (Mon, 14 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16760&view=rev Log Message: ----------- Merge of 16759: This initializes threads for glib and dbus, because under some circumstances multithreaded libraries are causing dbus badness (namely, gnome-vfs). This fix doesn't really belong in Gaim, but in the interest of expedience (we don't want to wait for upstream libraries to get their initializations all worked around to make things safe) the fix goes here. Note that all Gaim frontends will have to initialize glib threads if other threaded libraries which interact with glib or dbus or what-have-you come into play. Modified Paths: -------------- branches/v2_0_0/configure.ac branches/v2_0_0/src/Makefile.am branches/v2_0_0/src/dbus-server.c branches/v2_0_0/src/gtkmain.c Modified: branches/v2_0_0/configure.ac =================================================================== --- branches/v2_0_0/configure.ac 2006-08-14 21:46:17 UTC (rev 16759) +++ branches/v2_0_0/configure.ac 2006-08-14 21:48:08 UTC (rev 16760) @@ -632,7 +632,7 @@ AM_PATH_GLIB_2_0(2.0.0,,AC_MSG_ERROR([ *** GLib 2.0 is required to build Gaim; please make sure you have the GLib *** development headers installed. The latest version of GLib is -*** always available at http://www.gtk.org/.])) +*** always available at http://www.gtk.org/.]),gthread) AM_PATH_GTK_2_0(2.0.0,,AC_MSG_ERROR([ *** GTK+ 2.0 is required to build Gaim; please make sure you have the GTK+ *** development headers installed. The latest version of GTK+ is Modified: branches/v2_0_0/src/Makefile.am =================================================================== --- branches/v2_0_0/src/Makefile.am 2006-08-14 21:46:17 UTC (rev 16759) +++ branches/v2_0_0/src/Makefile.am 2006-08-14 21:48:08 UTC (rev 16760) @@ -339,6 +339,7 @@ gaim_LDFLAGS = -export-dynamic gaim_LDADD = \ @LIBOBJS@ \ + $(GLIB_LIBS) \ $(GTK_LIBS) \ $(DBUS_LIBS) \ $(GSTREAMER_LIBS) \ Modified: branches/v2_0_0/src/dbus-server.c =================================================================== --- branches/v2_0_0/src/dbus-server.c 2006-08-14 21:46:17 UTC (rev 16759) +++ branches/v2_0_0/src/dbus-server.c 2006-08-14 21:48:08 UTC (rev 16760) @@ -757,6 +757,9 @@ void gaim_dbus_init(void) { + if (g_thread_supported()) + dbus_g_thread_init(); + gaim_dbus_init_ids(); g_free(init_error); Modified: branches/v2_0_0/src/gtkmain.c =================================================================== --- branches/v2_0_0/src/gtkmain.c 2006-08-14 21:46:17 UTC (rev 16759) +++ branches/v2_0_0/src/gtkmain.c 2006-08-14 21:48:08 UTC (rev 16760) @@ -643,6 +643,15 @@ gtk_rc_add_default_file(search_path); g_free(search_path); +#if (defined(G_THREADS_ENABLED) && !defined(G_THREADS_IMPL_NONE)) + /* Since threads can be yanked in all unawares by other libraries, + * and some libraries aren't smart enough to initialize the thread + * subsystem when they need it, we need to do this here. We also + * threadify dbus when that gets initialized. Ugh. */ + if (!g_thread_supported()) + g_thread_init(NULL); + gdk_threads_init(); +#endif /* Glib has threads */ gui_check = gtk_init_check(&argc, &argv); if (!gui_check) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <ebl...@us...> - 2006-08-14 21:46:24
|
Revision: 16759 Author: eblanton Date: 2006-08-14 14:46:17 -0700 (Mon, 14 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16759&view=rev Log Message: ----------- This initializes threads for glib and dbus, because under some circumstances multithreaded libraries are causing dbus badness (namely, gnome-vfs). This fix doesn't really belong in Gaim, but in the interest of expedience (we don't want to wait for upstream libraries to get their initializations all worked around to make things safe) the fix goes here. Note that all Gaim frontends will have to initialize glib threads if other threaded libraries which interact with glib or dbus or what-have-you come into play. Modified Paths: -------------- trunk/configure.ac trunk/src/Makefile.am trunk/src/dbus-server.c trunk/src/gtkmain.c Modified: trunk/configure.ac =================================================================== --- trunk/configure.ac 2006-08-14 16:07:20 UTC (rev 16758) +++ trunk/configure.ac 2006-08-14 21:46:17 UTC (rev 16759) @@ -636,7 +636,7 @@ AM_PATH_GLIB_2_0(2.0.0,,AC_MSG_ERROR([ *** GLib 2.0 is required to build Gaim; please make sure you have the GLib *** development headers installed. The latest version of GLib is -*** always available at http://www.gtk.org/.])) +*** always available at http://www.gtk.org/.]),gthread) AM_PATH_GTK_2_0(2.0.0,,AC_MSG_ERROR([ *** GTK+ 2.0 is required to build Gaim; please make sure you have the GTK+ *** development headers installed. The latest version of GTK+ is Modified: trunk/src/Makefile.am =================================================================== --- trunk/src/Makefile.am 2006-08-14 16:07:20 UTC (rev 16758) +++ trunk/src/Makefile.am 2006-08-14 21:46:17 UTC (rev 16759) @@ -339,6 +339,7 @@ gaim_LDFLAGS = -export-dynamic gaim_LDADD = \ @LIBOBJS@ \ + $(GLIB_LIBS) \ $(GTK_LIBS) \ $(DBUS_LIBS) \ $(GSTREAMER_LIBS) \ Modified: trunk/src/dbus-server.c =================================================================== --- trunk/src/dbus-server.c 2006-08-14 16:07:20 UTC (rev 16758) +++ trunk/src/dbus-server.c 2006-08-14 21:46:17 UTC (rev 16759) @@ -757,6 +757,9 @@ void gaim_dbus_init(void) { + if (g_thread_supported()) + dbus_g_thread_init(); + gaim_dbus_init_ids(); g_free(init_error); Modified: trunk/src/gtkmain.c =================================================================== --- trunk/src/gtkmain.c 2006-08-14 16:07:20 UTC (rev 16758) +++ trunk/src/gtkmain.c 2006-08-14 21:46:17 UTC (rev 16759) @@ -643,6 +643,15 @@ gtk_rc_add_default_file(search_path); g_free(search_path); +#if (defined(G_THREADS_ENABLED) && !defined(G_THREADS_IMPL_NONE)) + /* Since threads can be yanked in all unawares by other libraries, + * and some libraries aren't smart enough to initialize the thread + * subsystem when they need it, we need to do this here. We also + * threadify dbus when that gets initialized. Ugh. */ + if (!g_thread_supported()) + g_thread_init(NULL); + gdk_threads_init(); +#endif /* Glib has threads */ gui_check = gtk_init_check(&argc, &argv); if (!gui_check) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <may...@us...> - 2006-08-14 16:07:31
|
Revision: 16758 Author: mayuan2006 Date: 2006-08-14 09:07:20 -0700 (Mon, 14 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16758&view=rev Log Message: ----------- change to support Showing Yahoo Message committed by MaYuan<may...@gm...> Modified Paths: -------------- branches/soc-2006-msnp13/src/protocols/msn/notification.c branches/soc-2006-msnp13/src/protocols/msn/oim.c branches/soc-2006-msnp13/src/protocols/msn/session.c branches/soc-2006-msnp13/src/protocols/msn/session.h Modified: branches/soc-2006-msnp13/src/protocols/msn/notification.c =================================================================== --- branches/soc-2006-msnp13/src/protocols/msn/notification.c 2006-08-14 12:58:04 UTC (rev 16757) +++ branches/soc-2006-msnp13/src/protocols/msn/notification.c 2006-08-14 16:07:20 UTC (rev 16758) @@ -426,6 +426,8 @@ { MsnMessage *msg; GaimConnection *gc; + const char *passport; + const char *content_type; gaim_debug_info("MaYuan","Process UBM payload:%s\n",payload); msg = msn_message_new_from_cmd(cmdproc->session, cmd); @@ -435,35 +437,62 @@ msn_message_show_readable(msg, "Notification", TRUE); #endif - gaim_debug_info("MaYuan","type:%d\n",msg->type); - if(msg->type == MSN_MSG_TEXT){ + gc = cmdproc->session->account->gc; + passport = msg->remote_user; + + content_type = msn_message_get_content_type(msg); + gaim_debug_info("MaYuan","type:%d\n",content_type); + if(!strcmp(content_type,"text/plain")){ const char *value; const char *body; char *body_str; char *body_enc; char *body_final; size_t body_len; - const char *passport; body = msn_message_get_bin_data(msg, &body_len); body_str = g_strndup(body, body_len); body_enc = g_markup_escape_text(body_str, -1); g_free(body_str); - passport = msg->remote_user; - gc = cmdproc->session->account->gc; - if ((value = msn_message_get_attr(msg, "X-MMS-IM-Format")) != NULL) { - char *pre, *post; + if ((value = msn_message_get_attr(msg, "X-MMS-IM-Format")) != NULL) { + char *pre, *post; - msn_parse_format(value, &pre, &post); - body_final = g_strdup_printf("%s%s%s", pre ? pre : "", - body_enc ? body_enc : "", post ? post : ""); - g_free(pre); - g_free(post); - g_free(body_enc); + msn_parse_format(value, &pre, &post); + body_final = g_strdup_printf("%s%s%s", pre ? pre : "", + body_enc ? body_enc : "", post ? post : ""); + g_free(pre); + g_free(post); + g_free(body_enc); } serv_got_im(gc, passport, body_final, 0, time(NULL)); } + if(!strcmp(content_type,"text/x-msmsgscontrol")){ + if(msn_message_get_attr(msg, "TypingUser") != NULL){ + serv_got_typing(gc, passport, MSN_TYPING_RECV_TIMEOUT, + GAIM_TYPING); + } + } + if(!strcmp(content_type,"text/x-msnmsgr-datacast")){ + char *username, *str; + GaimAccount *account; + GaimBuddy *buddy; + const char *user; + + account = cmdproc->session->account; + user = msg->remote_user; + + if ((buddy = gaim_find_buddy(account, user)) != NULL){ + username = g_markup_escape_text(gaim_buddy_get_alias(buddy), -1); + }else{ + username = g_markup_escape_text(user, -1); + } + + str = g_strdup_printf(_("%s just sent you a Nudge!"), username); + g_free(username); + msn_session_report_user(cmdproc->session,user,str,GAIM_MESSAGE_SYSTEM); + g_free(str); + } msn_message_destroy(msg); } @@ -650,43 +679,6 @@ } static void -add_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) -{ - MsnSession *session; - MsnUser *user; - const char *list; - const char *passport; - const char *friendly; - MsnListId list_id; - int group_id; - - list = cmd->params[1]; - passport = cmd->params[3]; - friendly = gaim_url_decode(cmd->params[4]); - - session = cmdproc->session; - - user = msn_userlist_find_user(session->userlist, passport); - - if (user == NULL){ - user = msn_user_new(session->userlist, passport, friendly); - msn_userlist_add_user(session->userlist, user); - }else{ - msn_user_set_friendly_name(user, friendly); - } - - list_id = msn_get_list_id(list); - - if (cmd->param_count >= 6) - group_id = atoi(cmd->params[5]); - else - group_id = -1; - - msn_got_add_user(session, user, list_id, group_id); - msn_user_update(user); -} - -static void add_error(MsnCmdProc *cmdproc, MsnTransaction *trans, int error) { MsnSession *session; @@ -1707,7 +1699,6 @@ /* Synchronous */ msn_table_add_cmd(cbs_table, "CHG", "CHG", NULL); msn_table_add_cmd(cbs_table, "CHG", "ILN", iln_cmd); - msn_table_add_cmd(cbs_table, "ADD", "ADD", add_cmd); msn_table_add_cmd(cbs_table, "ADL", "ILN", iln_cmd); msn_table_add_cmd(cbs_table, "REM", "REM", rem_cmd); msn_table_add_cmd(cbs_table, "USR", "USR", usr_cmd); Modified: branches/soc-2006-msnp13/src/protocols/msn/oim.c =================================================================== --- branches/soc-2006-msnp13/src/protocols/msn/oim.c 2006-08-14 12:58:04 UTC (rev 16757) +++ branches/soc-2006-msnp13/src/protocols/msn/oim.c 2006-08-14 16:07:20 UTC (rev 16758) @@ -202,35 +202,6 @@ msn_soap_read_cb(data,source,cond); } -/*get the conversation*/ -static GaimConversation * -msn_oim_get_conv(MsnOim *oim,const char *passport) -{ - GaimAccount *account; - GaimConversation * conv; - - g_return_val_if_fail(oim != NULL, NULL); - account = oim->session->account; - - conv = gaim_find_conversation_with_account(GAIM_CONV_TYPE_IM, - passport, account); - if(conv == NULL){ - conv = gaim_conversation_new(GAIM_CONV_TYPE_IM, account, passport); - } - return conv; -} - -/*put the OIM Message to User Conversation*/ -void -msn_oim_report_user(MsnOim *oim,const char *passport,char *msg) -{ - GaimConversation * conv; - - if ((conv = msn_oim_get_conv(oim,passport)) != NULL){ - gaim_conversation_write(conv, NULL, msg, GAIM_MESSAGE_SYSTEM, time(NULL)); - } -} - /*parse the oim XML data*/ void msn_parse_oim_msg(MsnOim *oim,const char *xmlmsg) @@ -250,7 +221,7 @@ nNode = xmlnode_get_child(mNode,"N"); nickname = xmlnode_get_data(nNode); gaim_debug_info("MaYuan","E:{%s},I:{%s},rTime:{%s}\n",passport,msgid,rTime); -// msn_oim_report_user(oim,passport,"hello"); +// msn_session_report_user(oim->session,passport,"hello"); oim->oim_list = g_list_append(oim->oim_list,msgid); } if(msn_soap_connected(oim->retrieveconn) == -1){ Modified: branches/soc-2006-msnp13/src/protocols/msn/session.c =================================================================== --- branches/soc-2006-msnp13/src/protocols/msn/session.c 2006-08-14 12:58:04 UTC (rev 16757) +++ branches/soc-2006-msnp13/src/protocols/msn/session.c 2006-08-14 16:07:20 UTC (rev 16758) @@ -163,6 +163,38 @@ return NULL; } +/*get the conversation*/ +GaimConversation * +msn_session_get_conv(MsnSession *session,const char *passport) +{ + GaimAccount *account; + GaimConversation * conv; + + g_return_val_if_fail(session != NULL, NULL); + account = session->account; + + conv = gaim_find_conversation_with_account(GAIM_CONV_TYPE_IM, + passport, account); + if(conv == NULL){ + conv = gaim_conversation_new(GAIM_CONV_TYPE_IM, account, passport); + } + return conv; +} + +/* put Message to User Conversation + * + * passport - the one want to talk to you + */ +void +msn_session_report_user(MsnSession *session,const char *passport,char *msg,GaimMessageFlags flags) +{ + GaimConversation * conv; + + if ((conv = msn_session_get_conv(session,passport)) != NULL){ + gaim_conversation_write(conv, NULL, msg, flags, time(NULL)); + } +} + MsnSwitchBoard * msn_session_find_swboard_with_conv(MsnSession *session, GaimConversation *conv) { Modified: branches/soc-2006-msnp13/src/protocols/msn/session.h =================================================================== --- branches/soc-2006-msnp13/src/protocols/msn/session.h 2006-08-14 12:58:04 UTC (rev 16757) +++ branches/soc-2006-msnp13/src/protocols/msn/session.h 2006-08-14 16:07:20 UTC (rev 16758) @@ -234,4 +234,12 @@ */ void msn_session_finish_login(MsnSession *session); +/*get conversation via session, + * If has one, return that,else create a new one; + */ +GaimConversation *msn_session_get_conv(MsnSession *session,const char *passport); + +/*post message to User*/ +void msn_session_report_user(MsnSession *session,const char *passport, + char *msg,GaimMessageFlags flags); #endif /* _MSN_SESSION_H_ */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <dat...@us...> - 2006-08-14 12:58:14
|
Revision: 16757 Author: datallah Date: 2006-08-14 05:58:04 -0700 (Mon, 14 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16757&view=rev Log Message: ----------- Merge from trunk: 16740 - Fix for CID 97 16710 - Fix CID 101. Also fix the behavior of adding a group to a fields list so that it doesn't matter if you add the group to a fields list before you add fields to the group or not. 16709 - Deal with inability to create key pair. (CID 139) 16708 - Fix CID 122 - Avoid an assert when the conversation has been closed before a custom emoticon finishes loading Modified Paths: -------------- branches/v2_0_0/plugins/log_reader.c branches/v2_0_0/src/protocols/msn/slp.c branches/v2_0_0/src/protocols/silc/util.c branches/v2_0_0/src/request.c Modified: branches/v2_0_0/plugins/log_reader.c =================================================================== --- branches/v2_0_0/plugins/log_reader.c 2006-08-14 08:36:25 UTC (rev 16756) +++ branches/v2_0_0/plugins/log_reader.c 2006-08-14 12:58:04 UTC (rev 16757) @@ -857,11 +857,10 @@ * friendly name or alias. For this test, "match" is defined as: * ^(friendly_name|alias)([^a-zA-Z0-9].*)?$ */ - from_name_matches = from_name != NULL && ( - (gaim_str_has_prefix(from_name, friendly_name) && + from_name_matches = (gaim_str_has_prefix(from_name, friendly_name) && !isalnum(*(from_name + friendly_name_length))) || (gaim_str_has_prefix(from_name, log->account->alias) && - !isalnum(*(from_name + alias_length)))); + !isalnum(*(from_name + alias_length))); to_name_matches = to_name != NULL && ( (gaim_str_has_prefix(to_name, friendly_name) && @@ -930,10 +929,11 @@ !isalnum(*(from_name + friendly_name_length))); - to_name_matches = (gaim_str_has_prefix( + to_name_matches = to_name && ( + (gaim_str_has_prefix( to_name, buddy->server_alias) && !isalnum(*(to_name + - friendly_name_length))); + friendly_name_length)))); if (from_name_matches) { if (!to_name_matches) { Modified: branches/v2_0_0/src/protocols/msn/slp.c =================================================================== --- branches/v2_0_0/src/protocols/msn/slp.c 2006-08-14 08:36:25 UTC (rev 16756) +++ branches/v2_0_0/src/protocols/msn/slp.c 2006-08-14 12:58:04 UTC (rev 16757) @@ -768,14 +768,15 @@ gc = slpcall->slplink->session->account->gc; who = slpcall->slplink->remote_user; - conv = gaim_find_conversation_with_account(GAIM_CONV_TYPE_ANY, who, gc->account); + if ((conv = gaim_find_conversation_with_account(GAIM_CONV_TYPE_ANY, who, gc->account))) { - /* FIXME: it would be better if we wrote the data as we received it - instead of all at once, calling write multiple times and - close once at the very end - */ - gaim_conv_custom_smiley_write(conv, slpcall->data_info, data, size); - gaim_conv_custom_smiley_close(conv, slpcall->data_info ); + /* FIXME: it would be better if we wrote the data as we received it + instead of all at once, calling write multiple times and + close once at the very end + */ + gaim_conv_custom_smiley_write(conv, slpcall->data_info, data, size); + gaim_conv_custom_smiley_close(conv, slpcall->data_info); + } #ifdef MSN_DEBUG_UD gaim_debug_info("msn", "Got smiley: %s\n", slpcall->data_info); #endif Modified: branches/v2_0_0/src/protocols/silc/util.c =================================================================== --- branches/v2_0_0/src/protocols/silc/util.c 2006-08-14 08:36:25 UTC (rev 16756) +++ branches/v2_0_0/src/protocols/silc/util.c 2006-08-14 12:58:04 UTC (rev 16757) @@ -205,12 +205,20 @@ /* If file doesn't exist */ if (errno == ENOENT) { gaim_connection_update_progress(gc, _("Creating SILC key pair..."), 1, 5); - silc_create_key_pair(SILCGAIM_DEF_PKCS, + if (!silc_create_key_pair(SILCGAIM_DEF_PKCS, SILCGAIM_DEF_PKCS_LEN, file_public_key, file_private_key, NULL, (gc->password == NULL) ? "" : gc->password, - NULL, NULL, NULL, FALSE); - g_stat(file_public_key, &st); + NULL, NULL, NULL, FALSE)) { + gaim_debug_error("silc", "Couldn't create key pair\n"); + return FALSE; + } + + if ((g_stat(file_public_key, &st)) == -1) { + gaim_debug_error("silc", "Couldn't stat '%s' public key, error: %s\n", + file_public_key, strerror(errno)); + return FALSE; + } } else { gaim_debug_error("silc", "Couldn't stat '%s' public key, error: %s\n", file_public_key, strerror(errno)); Modified: branches/v2_0_0/src/request.c =================================================================== --- branches/v2_0_0/src/request.c 2006-08-14 08:36:25 UTC (rev 16756) +++ branches/v2_0_0/src/request.c 2006-08-14 12:58:04 UTC (rev 16757) @@ -84,7 +84,13 @@ field = l->data; g_hash_table_insert(fields->fields, - g_strdup(gaim_request_field_get_id(field)), field); + g_strdup(gaim_request_field_get_id(field)), field); + + if (gaim_request_field_is_required(field)) { + fields->required_fields = + g_list_append(fields->required_fields, field); + } + } } @@ -280,15 +286,16 @@ { g_hash_table_insert(group->fields_list->fields, g_strdup(gaim_request_field_get_id(field)), field); + + if (gaim_request_field_is_required(field)) + { + group->fields_list->required_fields = + g_list_append(group->fields_list->required_fields, field); + } } field->group = group; - if (gaim_request_field_is_required(field)) - { - group->fields_list->required_fields = - g_list_append(group->fields_list->required_fields, field); - } } const char * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <the...@us...> - 2006-08-14 08:36:38
|
Revision: 16756 Author: thekingant Date: 2006-08-14 01:36:25 -0700 (Mon, 14 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16756&view=rev Log Message: ----------- Alright, backport SVN revisions 16742 through 16755 from HEAD to v2_0_0 This was mostly my changes to protocols to use gaim_proxy_connect_cancel() Modified Paths: -------------- branches/v2_0_0/plugins/ChangeLog.API branches/v2_0_0/src/connection.h branches/v2_0_0/src/ft.c branches/v2_0_0/src/protocols/irc/irc.c branches/v2_0_0/src/protocols/irc/irc.h 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/si.c branches/v2_0_0/src/protocols/msn/directconn.c branches/v2_0_0/src/protocols/msn/directconn.h branches/v2_0_0/src/protocols/msn/httpconn.c branches/v2_0_0/src/protocols/msn/httpconn.h branches/v2_0_0/src/protocols/msn/servconn.c branches/v2_0_0/src/protocols/msn/servconn.h branches/v2_0_0/src/protocols/oscar/flap_connection.c branches/v2_0_0/src/protocols/oscar/oscar.c branches/v2_0_0/src/protocols/oscar/oscar.h branches/v2_0_0/src/protocols/oscar/peer.c branches/v2_0_0/src/protocols/oscar/peer.h branches/v2_0_0/src/protocols/oscar/peer_proxy.c branches/v2_0_0/src/protocols/sametime/sametime.c branches/v2_0_0/src/protocols/silc/silc.c branches/v2_0_0/src/protocols/silc/silcgaim.h branches/v2_0_0/src/protocols/simple/simple.c branches/v2_0_0/src/protocols/toc/toc.c branches/v2_0_0/src/protocols/yahoo/yahoo.c branches/v2_0_0/src/protocols/yahoo/yahoo_filexfer.c branches/v2_0_0/src/protocols/yahoo/yahoo_picture.c branches/v2_0_0/src/protocols/yahoo/yahoochat.c branches/v2_0_0/src/protocols/yahoo/ycht.c branches/v2_0_0/src/proxy.c branches/v2_0_0/src/proxy.h branches/v2_0_0/src/sslconn.c branches/v2_0_0/src/upnp.c branches/v2_0_0/src/util.c Modified: branches/v2_0_0/plugins/ChangeLog.API =================================================================== --- branches/v2_0_0/plugins/ChangeLog.API 2006-08-14 08:32:52 UTC (rev 16755) +++ branches/v2_0_0/plugins/ChangeLog.API 2006-08-14 08:36:25 UTC (rev 16756) @@ -114,9 +114,9 @@ * All network activity has been updated to use non-blocking sockets. This means that plugins must be updated to expect such a socket from gaim_proxy_connect() and gaim_network_listen*(). - * gaim_proxy_connect(): changed to return NULL on error and a void * - handle on success, and changed parameters. It is now possible to - cancel connection attempts. + * gaim_proxy_connect(): changed to return NULL on error and a pointer + to a GaimProxyConnectInfo object which can be used to cancel + connection attempts using gaim_proxy_connect_cancel(). * 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 Modified: branches/v2_0_0/src/connection.h =================================================================== --- branches/v2_0_0/src/connection.h 2006-08-14 08:32:52 UTC (rev 16755) +++ branches/v2_0_0/src/connection.h 2006-08-14 08:36:25 UTC (rev 16756) @@ -271,6 +271,10 @@ * * @return @c TRUE if gc is valid. */ +/* + * TODO: Eventually this bad boy will be removed, because it is + * a gross fix for a crashy problem. + */ #define GAIM_CONNECTION_IS_VALID(gc) (g_list_find(gaim_connections_get_all(), (gc))) /*@}*/ Modified: branches/v2_0_0/src/ft.c =================================================================== --- branches/v2_0_0/src/ft.c 2006-08-14 08:32:52 UTC (rev 16755) +++ branches/v2_0_0/src/ft.c 2006-08-14 08:36:25 UTC (rev 16756) @@ -911,7 +911,7 @@ } static void -connect_cb(gpointer data, gint source) +connect_cb(gpointer data, gint source, const gchar *error_message) { GaimXfer *xfer = (GaimXfer *)data; @@ -946,7 +946,7 @@ /* Establish a file descriptor. */ gaim_proxy_connect(xfer->account, xfer->remote_ip, - xfer->remote_port, connect_cb, NULL, xfer); + xfer->remote_port, connect_cb, xfer); return; } Modified: branches/v2_0_0/src/protocols/irc/irc.c =================================================================== --- branches/v2_0_0/src/protocols/irc/irc.c 2006-08-14 08:32:52 UTC (rev 16755) +++ branches/v2_0_0/src/protocols/irc/irc.c 2006-08-14 08:36:25 UTC (rev 16756) @@ -46,7 +46,7 @@ /* static GList *irc_chat_info(GaimConnection *gc); */ static void irc_login(GaimAccount *account); static void irc_login_cb_ssl(gpointer data, GaimSslConnection *gsc, GaimInputCondition cond); -static void irc_login_cb(gpointer data, gint source); +static void irc_login_cb(gpointer data, gint source, const gchar *error_message); static void irc_ssl_connect_failure(GaimSslConnection *gsc, GaimSslErrorType error, gpointer data); static void irc_close(GaimConnection *gc); static int irc_im_send(GaimConnection *gc, const char *who, const char *what, GaimMessageFlags flags); @@ -283,7 +283,6 @@ struct irc_conn *irc; char **userparts; const char *username = gaim_account_get_username(account); - GaimProxyConnectInfo *connect_info; gc = gaim_account_get_connection(account); gc->flags |= GAIM_CONNECTION_NO_NEWLINES; @@ -325,11 +324,11 @@ if (!irc->gsc) { - connect_info = gaim_proxy_connect(account, irc->server, + irc->connect_info = gaim_proxy_connect(account, irc->server, gaim_account_get_int(account, "port", IRC_DEFAULT_PORT), - irc_login_cb, NULL, gc); + irc_login_cb, gc); - if (!connect_info || !gaim_account_get_connection(account)) { + if (!irc->connect_info || !gaim_account_get_connection(account)) { gaim_connection_error(gc, _("Couldn't create socket")); return; } @@ -394,22 +393,18 @@ } } -static void irc_login_cb(gpointer data, gint source) +static void irc_login_cb(gpointer data, gint source, const gchar *error_message) { GaimConnection *gc = data; struct irc_conn *irc = gc->proto_data; - GList *connections = gaim_connections_get_all(); + irc->connect_info = NULL; + if (source < 0) { gaim_connection_error(gc, _("Couldn't connect to host")); return; } - if (!g_list_find(connections, gc)) { - close(source); - return; - } - irc->fd = source; if (do_login(gc)) { @@ -443,8 +438,12 @@ if (irc == NULL) return; - irc_cmd_quit(irc, "quit", NULL, NULL); + if (irc->gsc || (irc->fd >= 0)) + irc_cmd_quit(irc, "quit", NULL, NULL); + if (irc->connect_info) + gaim_proxy_connect_cancel(irc->connect_info); + if (gc->inpa) gaim_input_remove(gc->inpa); Modified: branches/v2_0_0/src/protocols/irc/irc.h =================================================================== --- branches/v2_0_0/src/protocols/irc/irc.h 2006-08-14 08:32:52 UTC (rev 16755) +++ branches/v2_0_0/src/protocols/irc/irc.h 2006-08-14 08:36:25 UTC (rev 16756) @@ -54,6 +54,8 @@ guint timer; GHashTable *buddies; + GaimProxyConnectInfo *connect_info; + char *inbuf; int inbuflen; int inbufused; Modified: branches/v2_0_0/src/protocols/jabber/jabber.c =================================================================== --- branches/v2_0_0/src/protocols/jabber/jabber.c 2006-08-14 08:32:52 UTC (rev 16755) +++ branches/v2_0_0/src/protocols/jabber/jabber.c 2006-08-14 08:36:25 UTC (rev 16756) @@ -30,6 +30,7 @@ #include "message.h" #include "notify.h" #include "pluginpref.h" +#include "proxy.h" #include "prpl.h" #include "request.h" #include "server.h" @@ -418,21 +419,18 @@ static void -jabber_login_callback(gpointer data, gint source) +jabber_login_callback(gpointer data, gint source, const gchar *error) { GaimConnection *gc = data; JabberStream *js = gc->proto_data; + js->connect_info = NULL; + if (source < 0) { gaim_connection_error(gc, _("Couldn't connect to host")); return; } - if(!g_list_find(gaim_connections_get_all(), gc)) { - close(source); - return; - } - js->fd = source; if(js->state == JABBER_STREAM_CONNECTING) @@ -471,12 +469,10 @@ static void jabber_login_connect(JabberStream *js, const char *server, int port) { - GaimProxyConnectInfo *connect_info; + js->connect_info = gaim_proxy_connect(js->gc->account, server, + port, jabber_login_callback, js->gc); - connect_info = gaim_proxy_connect(js->gc->account, server, - port, jabber_login_callback, NULL, js->gc); - - if (connect_info == NULL) + if (js->connect_info == NULL) gaim_connection_error(js->gc, _("Unable to create socket")); } @@ -859,7 +855,6 @@ const char *connect_server = gaim_account_get_string(account, "connect_server", ""); const char *server; - GaimProxyConnectInfo *connect_info; js = gc->proto_data = g_new0(JabberStream, 1); js->gc = gc; @@ -909,11 +904,11 @@ } if(!js->gsc) { - connect_info = gaim_proxy_connect(account, server, + js->connect_info = gaim_proxy_connect(account, server, gaim_account_get_int(account, "port", 5222), - jabber_login_callback, NULL, gc); + jabber_login_callback, gc); - if (connect_info == NULL) + if (js->connect_info == NULL) gaim_connection_error(gc, _("Unable to create socket")); } } @@ -929,6 +924,9 @@ if (!gc->disconnect_timeout) jabber_send_raw(js, "</stream:stream>", -1); + if (js->connect_info) + gaim_proxy_connect_cancel(js->connect_info); + if(js->gsc) { #ifdef HAVE_OPENSSL if (!gc->disconnect_timeout) Modified: branches/v2_0_0/src/protocols/jabber/jabber.h =================================================================== --- branches/v2_0_0/src/protocols/jabber/jabber.h 2006-08-14 08:32:52 UTC (rev 16755) +++ branches/v2_0_0/src/protocols/jabber/jabber.h 2006-08-14 08:36:25 UTC (rev 16756) @@ -67,6 +67,8 @@ { int fd; + GaimProxyConnectInfo *connect_info; + #ifdef HAVE_LIBXML xmlParserCtxt *context; #else Modified: branches/v2_0_0/src/protocols/jabber/si.c =================================================================== --- branches/v2_0_0/src/protocols/jabber/si.c 2006-08-14 08:32:52 UTC (rev 16755) +++ branches/v2_0_0/src/protocols/jabber/si.c 2006-08-14 08:36:25 UTC (rev 16756) @@ -46,6 +46,8 @@ typedef struct _JabberSIXfer { JabberStream *js; + GaimProxyConnectInfo *connect_info; + gboolean accepted; char *stream_id; @@ -88,7 +90,8 @@ static void jabber_si_bytestreams_attempt_connect(GaimXfer *xfer); -static void jabber_si_bytestreams_connect_cb(gpointer data, gint source) +static void +jabber_si_bytestreams_connect_cb(gpointer data, gint source, const gchar *error_message) { GaimXfer *xfer = data; JabberSIXfer *jsx = xfer->data; @@ -97,6 +100,7 @@ struct bytestreams_streamhost *streamhost = jsx->streamhosts->data; gaim_proxy_info_destroy(jsx->gpi); + jsx->connect_info = NULL; if(source < 0) { jsx->streamhosts = g_list_remove(jsx->streamhosts, streamhost); @@ -167,8 +171,18 @@ for(i=0; i<20; i++, p+=2) snprintf(p, 3, "%02x", hashval[i]); - gaim_proxy_connect_socks5(jsx->gpi, dstaddr, 0, jabber_si_bytestreams_connect_cb, NULL, xfer); + jsx->connect_info = gaim_proxy_connect_socks5(jsx->gpi, dstaddr, 0, + jabber_si_bytestreams_connect_cb, xfer); g_free(dstaddr); + + if (jsx->connect_info == NULL) + { + jsx->streamhosts = g_list_remove(jsx->streamhosts, streamhost); + g_free(streamhost->jid); + g_free(streamhost->host); + g_free(streamhost); + jabber_si_bytestreams_attempt_connect(xfer); + } } void jabber_bytestreams_parse(JabberStream *js, xmlnode *packet) @@ -682,6 +696,9 @@ js->file_transfers = g_list_remove(js->file_transfers, xfer); + if (jsx->connect_info != NULL) + gaim_proxy_connect_cancel(jsx->connect_info); + g_free(jsx->stream_id); g_free(jsx->iq_id); /* XXX: free other stuff */ Modified: branches/v2_0_0/src/protocols/msn/directconn.c =================================================================== --- branches/v2_0_0/src/protocols/msn/directconn.c 2006-08-14 08:32:52 UTC (rev 16755) +++ branches/v2_0_0/src/protocols/msn/directconn.c 2006-08-14 08:36:25 UTC (rev 16756) @@ -288,11 +288,6 @@ /* ERROR */ gaim_debug_error("msn", "error reading\n"); - if (directconn->inpa) - gaim_input_remove(directconn->inpa); - - close(directconn->fd); - msn_directconn_destroy(directconn); return; @@ -307,11 +302,6 @@ /* ERROR */ gaim_debug_error("msn", "error reading\n"); - if (directconn->inpa) - gaim_input_remove(directconn->inpa); - - close(directconn->fd); - msn_directconn_destroy(directconn); return; @@ -358,17 +348,12 @@ /* ERROR */ gaim_debug_error("msn", "error reading\n"); - if (directconn->inpa) - gaim_input_remove(directconn->inpa); - - close(directconn->fd); - msn_directconn_destroy(directconn); } } static void -connect_cb(gpointer data, gint source) +connect_cb(gpointer data, gint source, const gchar *error_message) { MsnDirectConn* directconn; int fd; @@ -376,6 +361,7 @@ gaim_debug_misc("msn", "directconn: connect_cb: %d\n", source); directconn = data; + directconn->connect_info = NULL; if (TRUE) { @@ -423,7 +409,6 @@ msn_directconn_connect(MsnDirectConn *directconn, const char *host, int port) { MsnSession *session; - GaimProxyConnectInfo *connect_info; g_return_val_if_fail(directconn != NULL, FALSE); g_return_val_if_fail(host != NULL, TRUE); @@ -438,10 +423,10 @@ } #endif - connect_info = gaim_proxy_connect(session->account, host, port, - connect_cb, NULL, directconn); + directconn->connect_info = gaim_proxy_connect(session->account, host, port, + connect_cb, directconn); - if (connect_info != NULL) + if (directconn->connect_info != NULL) { return TRUE; } @@ -491,6 +476,15 @@ void msn_directconn_destroy(MsnDirectConn *directconn) { + if (directconn->connect_info != NULL) + gaim_proxy_connect_cancel(directconn->connect_info); + + if (directconn->inpa != 0) + gaim_input_remove(directconn->inpa); + + if (directconn->fd >= 0) + close(directconn->fd); + if (directconn->nonce != NULL) g_free(directconn->nonce); Modified: branches/v2_0_0/src/protocols/msn/directconn.h =================================================================== --- branches/v2_0_0/src/protocols/msn/directconn.h 2006-08-14 08:32:52 UTC (rev 16755) +++ branches/v2_0_0/src/protocols/msn/directconn.h 2006-08-14 08:36:25 UTC (rev 16756) @@ -35,6 +35,8 @@ MsnSlpLink *slplink; MsnSlpCall *initial_call; + GaimProxyConnectInfo *connect_info; + gboolean acked; char *nonce; Modified: branches/v2_0_0/src/protocols/msn/httpconn.c =================================================================== --- branches/v2_0_0/src/protocols/msn/httpconn.c 2006-08-14 08:32:52 UTC (rev 16755) +++ branches/v2_0_0/src/protocols/msn/httpconn.c 2006-08-14 08:36:25 UTC (rev 16756) @@ -693,21 +693,12 @@ } static void -connect_cb(gpointer data, gint source) +connect_cb(gpointer data, gint source, const gchar *error_message) { - MsnHttpConn *httpconn = data; + MsnHttpConn *httpconn; - /* - TODO: Need to do this in case the account is disabled while connecting - if (!g_list_find(gaim_connections_get_all(), gc)) - { - if (source >= 0) - close(source); - destroy_new_conn_data(new_conn_data); - return; - } - */ - + httpconn = data; + httpconn->connect_info = NULL; httpconn->fd = source; if (source >= 0) @@ -729,8 +720,6 @@ gboolean msn_httpconn_connect(MsnHttpConn *httpconn, const char *host, int port) { - GaimProxyConnectInfo *connect_info; - g_return_val_if_fail(httpconn != NULL, FALSE); g_return_val_if_fail(host != NULL, FALSE); g_return_val_if_fail(port > 0, FALSE); @@ -738,10 +727,10 @@ if (httpconn->connected) msn_httpconn_disconnect(httpconn); - connect_info = gaim_proxy_connect(httpconn->session->account, - "gateway.messenger.hotmail.com", 80, connect_cb, NULL, httpconn); + httpconn->connect_info = gaim_proxy_connect(httpconn->session->account, + "gateway.messenger.hotmail.com", 80, connect_cb, httpconn); - if (connect_info != NULL) + if (httpconn->connect_info != NULL) { httpconn->waiting_response = TRUE; httpconn->connected = TRUE; @@ -758,11 +747,18 @@ if (!httpconn->connected) return; + if (httpconn->connect_info != NULL) + { + gaim_proxy_connect_cancel(httpconn->connect_info); + httpconn->connect_info = NULL; + } + if (httpconn->timer) + { gaim_timeout_remove(httpconn->timer); + httpconn->timer = 0; + } - httpconn->timer = 0; - if (httpconn->inpa > 0) { gaim_input_remove(httpconn->inpa); @@ -770,6 +766,7 @@ } close(httpconn->fd); + httpconn->fd = -1; g_free(httpconn->rx_buf); httpconn->rx_buf = NULL; Modified: branches/v2_0_0/src/protocols/msn/httpconn.h =================================================================== --- branches/v2_0_0/src/protocols/msn/httpconn.h 2006-08-14 08:32:52 UTC (rev 16755) +++ branches/v2_0_0/src/protocols/msn/httpconn.h 2006-08-14 08:36:25 UTC (rev 16756) @@ -37,6 +37,8 @@ MsnSession *session; /**< The MSN Session. */ MsnServConn *servconn; /**< The connection object. */ + GaimProxyConnectInfo *connect_info; + char *full_session_id; /**< The full session id. */ char *session_id; /**< The trimmed session id. */ Modified: branches/v2_0_0/src/protocols/msn/servconn.c =================================================================== --- branches/v2_0_0/src/protocols/msn/servconn.c 2006-08-14 08:32:52 UTC (rev 16755) +++ branches/v2_0_0/src/protocols/msn/servconn.c 2006-08-14 08:36:25 UTC (rev 16756) @@ -166,10 +166,12 @@ **************************************************************************/ static void -connect_cb(gpointer data, gint source) +connect_cb(gpointer data, gint source, const gchar *error_message) { - MsnServConn *servconn = data; + MsnServConn *servconn; + servconn = data; + servconn->connect_info = NULL; servconn->processing = FALSE; if (servconn->wasted) @@ -199,7 +201,6 @@ msn_servconn_connect(MsnServConn *servconn, const char *host, int port) { MsnSession *session; - GaimProxyConnectInfo *connect_info; g_return_val_if_fail(servconn != NULL, FALSE); g_return_val_if_fail(host != NULL, FALSE); @@ -232,10 +233,10 @@ return TRUE; } - connect_info = gaim_proxy_connect(session->account, host, port, - connect_cb, NULL, servconn); + servconn->connect_info = gaim_proxy_connect(session->account, host, port, + connect_cb, servconn); - if (connect_info != NULL) + if (servconn->connect_info != NULL) { servconn->processing = TRUE; return TRUE; @@ -267,6 +268,12 @@ return; } + if (servconn->connect_info != NULL) + { + gaim_proxy_connect_cancel(servconn->connect_info); + servconn->connect_info = NULL; + } + if (servconn->inpa > 0) { gaim_input_remove(servconn->inpa); Modified: branches/v2_0_0/src/protocols/msn/servconn.h =================================================================== --- branches/v2_0_0/src/protocols/msn/servconn.h 2006-08-14 08:32:52 UTC (rev 16755) +++ branches/v2_0_0/src/protocols/msn/servconn.h 2006-08-14 08:36:25 UTC (rev 16756) @@ -63,6 +63,8 @@ MsnSession *session; /**< The MSN session of this connection. */ MsnCmdProc *cmdproc; /**< The command processor of this connection. */ + GaimProxyConnectInfo *connect_info; + gboolean connected; /**< A flag that states if it's connected. */ gboolean processing; /**< A flag that states if something is working with this connection. */ Modified: branches/v2_0_0/src/protocols/oscar/flap_connection.c =================================================================== --- branches/v2_0_0/src/protocols/oscar/flap_connection.c 2006-08-14 08:32:52 UTC (rev 16755) +++ branches/v2_0_0/src/protocols/oscar/flap_connection.c 2006-08-14 08:36:25 UTC (rev 16756) @@ -21,6 +21,7 @@ #include "oscar.h" #include "eventloop.h" +#include "proxy.h" #ifndef _WIN32 #include <netdb.h> @@ -131,21 +132,37 @@ /** * Close (but not free) a connection. * - * This leaves everything untouched except for setting the fd - * to -1 (used to recognize dead connections). + * This cancels any currently pending connection attempt, + * closes any open fd and frees the auth cookie. * * @param conn The connection to close. */ void flap_connection_close(OscarData *od, FlapConnection *conn) { - if (conn->fd == -1) - return; + if (conn->connect_info != NULL) + { + gaim_proxy_connect_cancel(conn->connect_info); + conn->connect_info = NULL; + } - if (conn->type == SNAC_FAMILY_LOCATE) - flap_connection_send_close(od, conn); + if (conn->connect_data != NULL) + { + if (conn->type == SNAC_FAMILY_CHAT) + { + oscar_chat_destroy(conn->connect_data); + conn->connect_data = NULL; + } + } - close(conn->fd); + if (conn->fd != -1) + { + if (conn->type == SNAC_FAMILY_LOCATE) + flap_connection_send_close(od, conn); + + close(conn->fd); + conn->fd = -1; + } } static void @@ -188,6 +205,8 @@ flap_connection_close(od, conn); + g_free(conn->cookie); + if (conn->watcher_incoming != 0) gaim_input_remove(conn->watcher_incoming); if (conn->watcher_outgoing != 0) Modified: branches/v2_0_0/src/protocols/oscar/oscar.c =================================================================== --- branches/v2_0_0/src/protocols/oscar/oscar.c 2006-08-14 08:32:52 UTC (rev 16755) +++ branches/v2_0_0/src/protocols/oscar/oscar.c 2006-08-14 08:36:25 UTC (rev 16756) @@ -76,35 +76,11 @@ static guint8 features_icq_offline[] = {0x01}; static guint8 ck[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; -typedef struct _NewFlapConnectionData NewFlapConnectionData; -struct _NewFlapConnectionData -{ - GaimConnection *gc; - FlapConnection *conn; - guint16 cookielen; - guint8 *cookie; - gpointer data; -}; - struct create_room { char *name; int exchange; }; -struct chat_connection -{ - char *name; - char *show; /* AOL did something funny to us */ - guint16 exchange; - guint16 instance; - FlapConnection *conn; - int id; - GaimConnection *gc; /* i hate this. */ - GaimConversation *conv; /* bah. */ - int maxlen; - int maxvis; -}; - struct oscar_ask_directim_data { OscarData *od; @@ -903,7 +879,7 @@ return NULL; } -static void +void oscar_chat_destroy(struct chat_connection *cc) { g_free(cc->name); @@ -925,46 +901,25 @@ oscar_chat_destroy(cc); } -static void -destroy_new_conn_data(NewFlapConnectionData *new_conn_data) -{ - if ((new_conn_data->data != NULL) && - (new_conn_data->conn->type == SNAC_FAMILY_CHAT)) - { - oscar_chat_destroy(new_conn_data->data); - } - g_free(new_conn_data->cookie); - g_free(new_conn_data); -} - /** * This is the callback function anytime gaim_proxy_connect() * establishes a new TCP connection with an oscar host. Depending * on the type of host, we do a few different things here. */ static void -connection_established_cb(gpointer data, gint source) +connection_established_cb(gpointer data, gint source, const gchar *error_message) { - NewFlapConnectionData *new_conn_data; GaimConnection *gc; OscarData *od; GaimAccount *account; FlapConnection *conn; - new_conn_data = data; - gc = new_conn_data->gc; - - if (!GAIM_CONNECTION_IS_VALID(gc)) - { - if (source >= 0) - close(source); - destroy_new_conn_data(new_conn_data); - return; - } - - od = gc->proto_data; + conn = data; + od = conn->od; + gc = od->gc; account = gaim_connection_get_account(gc); - conn = new_conn_data->conn; + + conn->connect_info = NULL; conn->fd = source; if (source < 0) @@ -978,7 +933,6 @@ else /* Maybe we should call this for BOS connections, too? */ flap_connection_schedule_destroy(conn, OSCAR_DISCONNECT_COULD_NOT_CONNECT); - destroy_new_conn_data(new_conn_data); return; } @@ -986,7 +940,7 @@ conn->type); conn->watcher_incoming = gaim_input_add(conn->fd, GAIM_INPUT_READ, flap_connection_recv_cb, conn); - if (new_conn_data->cookie == NULL) + if (conn->cookie == NULL) { if (!aim_sn_is_icq(gaim_account_get_username(account))) /* @@ -997,8 +951,12 @@ flap_connection_send_version(od, conn); } else + { flap_connection_send_version_with_cookie(od, conn, - new_conn_data->cookielen, new_conn_data->cookie); + conn->cookielen, conn->cookie); + g_free(conn->cookie); + conn->cookie = NULL; + } if (conn->type == SNAC_FAMILY_AUTH) { @@ -1014,11 +972,9 @@ } else if (conn->type == SNAC_FAMILY_CHAT) { - od->oscar_chats = g_slist_append(od->oscar_chats, new_conn_data->data); - new_conn_data->data = NULL; + od->oscar_chats = g_slist_append(od->oscar_chats, conn->connect_data); + conn->connect_data = NULL; } - - destroy_new_conn_data(new_conn_data); } static void @@ -1152,7 +1108,7 @@ { GaimConnection *gc; OscarData *od; - NewFlapConnectionData *new_conn_data; + FlapConnection *newconn; gc = gaim_account_get_connection(account); od = gc->proto_data = oscar_data_new(); @@ -1240,17 +1196,12 @@ /* Connect to core Gaim signals */ gaim_prefs_connect_callback(gc, "/plugins/prpl/oscar/recent_buddies", recent_buddies_cb, gc); - new_conn_data = g_new(NewFlapConnectionData, 1); - new_conn_data->gc = gc; - new_conn_data->conn = flap_connection_new(od, SNAC_FAMILY_AUTH); - new_conn_data->cookielen = 0; - new_conn_data->cookie = NULL; - new_conn_data->data = NULL; - - if (gaim_proxy_connect(account, + newconn = flap_connection_new(od, SNAC_FAMILY_AUTH); + newconn->connect_info = gaim_proxy_connect(account, gaim_account_get_string(account, "server", OSCAR_DEFAULT_LOGIN_SERVER), gaim_account_get_int(account, "port", OSCAR_DEFAULT_LOGIN_PORT), - connection_established_cb, NULL, new_conn_data) == NULL) + connection_established_cb, newconn); + if (newconn->connect_info == NULL) { gaim_connection_error(gc, _("Couldn't connect to host")); return; @@ -1295,8 +1246,7 @@ GaimAccount *account = gc->account; char *host; int port; int i; - GaimProxyConnectInfo *connect_info; - NewFlapConnectionData *new_conn_data; + FlapConnection *newconn; va_list ap; struct aim_authresp_info *info; @@ -1361,16 +1311,14 @@ } } host = g_strndup(info->bosip, i); - new_conn_data = g_new(NewFlapConnectionData, 1); - new_conn_data->gc = gc; - new_conn_data->conn = flap_connection_new(od, SNAC_FAMILY_LOCATE); - new_conn_data->cookielen = info->cookielen; - new_conn_data->cookie = g_memdup(info->cookie, info->cookielen); - new_conn_data->data = NULL; - connect_info = gaim_proxy_connect(gc->account, host, port, - connection_established_cb, NULL, new_conn_data); + newconn = flap_connection_new(od, SNAC_FAMILY_LOCATE); + newconn->cookielen = info->cookielen; + newconn->cookie = g_memdup(info->cookie, info->cookielen); + newconn->connect_info = gaim_proxy_connect(account, host, port, + connection_established_cb, newconn); g_free(host); - if (connect_info == NULL) { + if (newconn->connect_info == NULL) + { gaim_connection_error(gc, _("Could Not Connect")); od->killme = TRUE; return 0; @@ -1482,11 +1430,18 @@ } static void -straight_to_hell(gpointer data, gint source) +straight_to_hell(gpointer data, gint source, const gchar *error_message) { struct pieceofcrap *pos = data; gchar *buf; + if (!GAIM_CONNECTION_IS_VALID(pos->gc)) + { + g_free(pos->modname); + g_free(pos); + return; + } + pos->fd = source; if (source < 0) { @@ -1496,8 +1451,7 @@ _("Gaim was unable to get a valid AIM login hash."), buf); g_free(buf); - if (pos->modname) - g_free(pos->modname); + g_free(pos->modname); g_free(pos); return; } @@ -1506,8 +1460,7 @@ pos->offset, pos->len, pos->modname ? pos->modname : ""); write(pos->fd, buf, strlen(buf)); g_free(buf); - if (pos->modname) - g_free(pos->modname); + g_free(pos->modname); pos->inpa = gaim_input_add(pos->fd, GAIM_INPUT_READ, damn_you, pos); return; } @@ -1573,8 +1526,9 @@ pos->len = len; pos->modname = g_strdup(modname); + /* TODO: Keep track of this return value. */ if (gaim_proxy_connect(pos->gc->account, "gaim.sourceforge.net", 80, - straight_to_hell, NULL, pos) == NULL) + straight_to_hell, pos) == NULL) { char buf[256]; if (pos->modname) @@ -1622,7 +1576,7 @@ GaimAccount *account = gaim_connection_get_account(gc); char *host, *separator; int port; - NewFlapConnectionData *new_conn_data; + FlapConnection *newconn; va_list ap; struct aim_redirect_data *redir; @@ -1642,36 +1596,30 @@ gaim_debug_info("oscar", "Connecting to FLAP server %s:%d of type 0x%04hx\n", host, port, redir->group); - new_conn_data = g_new(NewFlapConnectionData, 1); - new_conn_data->gc = gc; - new_conn_data->conn = flap_connection_new(od, redir->group); - new_conn_data->cookielen = redir->cookielen; - new_conn_data->cookie = g_memdup(redir->cookie, redir->cookielen); - if (new_conn_data->conn->type == SNAC_FAMILY_CHAT) + newconn = flap_connection_new(od, redir->group); + newconn->cookielen = redir->cookielen; + newconn->cookie = g_memdup(redir->cookie, redir->cookielen); + if (newconn->type == SNAC_FAMILY_CHAT) { struct chat_connection *cc; cc = g_new0(struct chat_connection, 1); - cc->conn = new_conn_data->conn; + cc->conn = newconn; cc->gc = gc; cc->name = g_strdup(redir->chat.room); cc->exchange = redir->chat.exchange; cc->instance = redir->chat.instance; cc->show = extract_name(redir->chat.room); - new_conn_data->data = cc; + newconn->connect_data = cc; gaim_debug_info("oscar", "Connecting to chat room %s exchange %hu\n", cc->name, cc->exchange); } - else - { - new_conn_data->data = NULL; - } - if (gaim_proxy_connect(account, host, port, connection_established_cb, NULL, new_conn_data) == NULL) + newconn->connect_info = gaim_proxy_connect(account, host, port, + connection_established_cb, newconn); + if (newconn->connect_info == NULL) { - flap_connection_schedule_destroy(new_conn_data->conn, - OSCAR_DISCONNECT_COULD_NOT_CONNECT); + flap_connection_schedule_destroy(newconn, OSCAR_DISCONNECT_COULD_NOT_CONNECT); gaim_debug_error("oscar", "Unable to connect to FLAP server " "of type 0x%04hx\n", redir->group); - destroy_new_conn_data(new_conn_data); } g_free(host); Modified: branches/v2_0_0/src/protocols/oscar/oscar.h =================================================================== --- branches/v2_0_0/src/protocols/oscar/oscar.h 2006-08-14 08:32:52 UTC (rev 16755) +++ branches/v2_0_0/src/protocols/oscar/oscar.h 2006-08-14 08:36:25 UTC (rev 16756) @@ -33,6 +33,7 @@ #include "debug.h" #include "eventloop.h" #include "internal.h" +#include "proxy.h" #include <stdio.h> #include <string.h> @@ -366,6 +367,12 @@ guint destroy_timeout; OscarDisconnectReason disconnect_reason; + /* A few variables that are only used when connecting */ + GaimProxyConnectInfo *connect_info; + guint16 cookielen; + guint8 *cookie; + gpointer connect_data; + int fd; FlapFrame buffer_incoming; GaimCircBuffer *buffer_outgoing; @@ -661,6 +668,9 @@ guint32 minmsginterval; /* in milliseconds? */ }; +/* + * TODO: Should probably combine this with struct chat_connection. + */ struct aim_chat_roominfo { guint16 exchange; @@ -668,6 +678,25 @@ guint16 instance; }; +struct chat_connection +{ + char *name; + char *show; /* AOL did something funny to us */ + guint16 exchange; + guint16 instance; + FlapConnection *conn; + int id; + GaimConnection *gc; + GaimConversation *conv; + int maxlen; + int maxvis; +}; + +/* + * All this chat struct stuff should be in family_chat.c + */ +void oscar_chat_destroy(struct chat_connection *cc); + #define AIM_IMFLAGS_AWAY 0x0001 /* mark as an autoreply */ #define AIM_IMFLAGS_ACK 0x0002 /* request a receipt notice */ #define AIM_IMFLAGS_BUDDYREQ 0x0010 /* buddy icon requested */ Modified: branches/v2_0_0/src/protocols/oscar/peer.c =================================================================== --- branches/v2_0_0/src/protocols/oscar/peer.c 2006-08-14 08:32:52 UTC (rev 16755) +++ branches/v2_0_0/src/protocols/oscar/peer.c 2006-08-14 08:36:25 UTC (rev 16756) @@ -482,7 +482,7 @@ * either connected or failed to connect. */ static void -peer_connection_established_cb(gpointer data, gint source) +peer_connection_established_cb(gpointer data, gint source, const gchar *error_message) { PeerConnection *conn; @@ -658,9 +658,7 @@ gaim_debug_info("oscar", "Peer connection timed out after 15 seconds. " "Trying next method...\n"); - gaim_proxy_connect_cancel(conn->connect_info); - conn->connect_info = NULL; - conn->connect_timeout_timer = 0; + peer_connection_close(conn); peer_connection_trynext(conn); @@ -706,7 +704,7 @@ conn->connect_info = gaim_proxy_connect(account, conn->verifiedip, conn->port, - peer_connection_established_cb, NULL, conn); + peer_connection_established_cb, conn); if (conn->connect_info != NULL) { /* Connecting... */ @@ -741,7 +739,7 @@ conn->connect_info = gaim_proxy_connect(account, conn->clientip, conn->port, - peer_connection_established_cb, NULL, conn); + peer_connection_established_cb, conn); if (conn->connect_info != NULL) { /* Connecting... */ @@ -813,7 +811,7 @@ conn->connect_info = gaim_proxy_connect(account, (conn->proxyip != NULL) ? conn->proxyip : PEER_PROXY_SERVER, PEER_PROXY_PORT, - peer_proxy_connection_established_cb, NULL, conn); + peer_proxy_connection_established_cb, conn); if (conn->connect_info != NULL) { /* Connecting... */ Modified: branches/v2_0_0/src/protocols/oscar/peer.h =================================================================== --- branches/v2_0_0/src/protocols/oscar/peer.h 2006-08-14 08:32:52 UTC (rev 16755) +++ branches/v2_0_0/src/protocols/oscar/peer.h 2006-08-14 08:36:25 UTC (rev 16756) @@ -265,7 +265,7 @@ /* * For peer proxying */ -void peer_proxy_connection_established_cb(gpointer data, gint source); +void peer_proxy_connection_established_cb(gpointer data, gint source, const gchar *error_message); #if 0 int peer_oft_sendheader(OscarData *od, guint16 type, PeerConnection *peer_connection); Modified: branches/v2_0_0/src/protocols/oscar/peer_proxy.c =================================================================== --- branches/v2_0_0/src/protocols/oscar/peer_proxy.c 2006-08-14 08:32:52 UTC (rev 16755) +++ branches/v2_0_0/src/protocols/oscar/peer_proxy.c 2006-08-14 08:36:25 UTC (rev 16756) @@ -326,7 +326,7 @@ * either connected or failed to connect. */ void -peer_proxy_connection_established_cb(gpointer data, gint source) +peer_proxy_connection_established_cb(gpointer data, gint source, const gchar *error_message) { PeerConnection *conn; Modified: branches/v2_0_0/src/protocols/sametime/sametime.c =================================================================== --- branches/v2_0_0/src/protocols/sametime/sametime.c 2006-08-14 08:32:52 UTC (rev 16755) +++ branches/v2_0_0/src/protocols/sametime/sametime.c 2006-08-14 08:36:25 UTC (rev 16756) @@ -4,17 +4,17 @@ Adds Lotus Sametime support to Gaim using the Meanwhile library Copyright (C) 2004 Christopher (siege) O'Brien <si...@pr...> - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, @@ -226,6 +226,7 @@ /** socket fd */ int socket; gint outpa; /* like inpa, but the other way */ + GaimProxyConnectInfo *connect_info; /** circular buffer for outgoing data */ GaimCircBuffer *sock_buf; @@ -310,7 +311,7 @@ /* connection functions */ -static void connect_cb(gpointer data, gint source); +static void connect_cb(gpointer data, gint source, const gchar *error_message); /* ----- session ------ */ @@ -1409,7 +1410,7 @@ port = gaim_account_get_int(account, MW_KEY_PORT, MW_PLUGIN_DEFAULT_PORT); if(gaim_account_get_bool(account, MW_KEY_FORCE, FALSE) || - (gaim_proxy_connect(account, host, port, connect_cb, NULL, pd) == NULL)) { + (gaim_proxy_connect(account, host, port, connect_cb, pd) == NULL)) { mwSession_forceLogin(session); } @@ -1669,15 +1670,12 @@ /** Callback passed to gaim_proxy_connect when an account is logged in, and if the session logging in receives a redirect message */ -static void connect_cb(gpointer data, gint source) { +static void connect_cb(gpointer data, gint source, const gchar *error_message) { struct mwGaimPluginData *pd = data; GaimConnection *gc = pd->gc; - if(! g_list_find(gaim_connections_get_all(), pd->gc)) { - close(source); - g_return_if_reached(); - } + pd->connect_info = NULL; if(source < 0) { /* connection failed */ @@ -3683,7 +3681,8 @@ gaim_connection_update_progress(gc, _("Connecting"), 1, MW_CONNECT_STEPS); - if(gaim_proxy_connect(account, host, port, connect_cb, NULL, pd) == NULL) { + pd->connect_info = gaim_proxy_connect(account, host, port, connect_cb, pd); + if(pd->connect_info == NULL) { gaim_connection_error(gc, _("Unable to connect to host")); } } @@ -3716,6 +3715,11 @@ gc->inpa = 0; } + if(pd->connect_info != NULL) { + gaim_proxy_connect_cancel(pd->connect_info); + pd->connect_info = NULL; + } + /* clean up the rest */ mwGaimPluginData_free(pd); } Modified: branches/v2_0_0/src/protocols/silc/silc.c =================================================================== --- branches/v2_0_0/src/protocols/silc/silc.c 2006-08-14 08:32:52 UTC (rev 16755) +++ branches/v2_0_0/src/protocols/silc/silc.c 2006-08-14 08:36:25 UTC (rev 16756) @@ -141,7 +141,7 @@ } static void -silcgaim_login_connected(gpointer data, gint source) +silcgaim_login_connected(gpointer data, gint source, const gchar *error_message) { GaimConnection *gc = data; SilcGaim sg; @@ -153,20 +153,14 @@ g_return_if_fail(gc != NULL); - if (!GAIM_CONNECTION_IS_VALID(gc)) { - close(source); - return; - } + sg = gc->proto_data; + sg->connect_info = NULL; if (source < 0) { gaim_connection_error(gc, _("Connection failed")); return; } - sg = gc->proto_data; - if (sg == NULL) - return; - client = sg->client; account = sg->account; @@ -363,11 +357,12 @@ gc->proto_data = sg; /* Connect to the SILC server */ - if (gaim_proxy_connect(account, + sg->connect_info = gaim_proxy_connect(account, gaim_account_get_string(account, "server", "silc.silcnet.org"), gaim_account_get_int(account, "port", 706), - silcgaim_login_connected, NULL, gc) == NULL) + silcgaim_login_connected, gc); + if (sg->connect_info == NULL) { gaim_connection_error(gc, _("Unable to create connection")); return; @@ -387,6 +382,8 @@ SilcGaim sg = (SilcGaim)context; silc_client_stop(sg->client); silc_client_free(sg->client); + if (sg->connect_info != NULL) + gaim_proxy_connect_cancel(sg->connect_info); #ifdef HAVE_SILCMIME_H if (sg->mimeass) silc_mime_assembler_free(sg->mimeass); Modified: branches/v2_0_0/src/protocols/silc/silcgaim.h =================================================================== --- branches/v2_0_0/src/protocols/silc/silcgaim.h 2006-08-14 08:32:52 UTC (rev 16755) +++ branches/v2_0_0/src/protocols/silc/silcgaim.h 2006-08-14 08:36:25 UTC (rev 16756) @@ -67,6 +67,7 @@ SilcClient client; SilcClientConnection conn; + GaimProxyConnectInfo *connect_info; guint scheduler; GaimConnection *gc; GaimAccount *account; Modified: branches/v2_0_0/src/protocols/simple/simple.c =================================================================== --- branches/v2_0_0/src/protocols/simple/simple.c 2006-08-14 08:32:52 UTC (rev 16755) +++ branches/v2_0_0/src/protocols/simple/simple.c 2006-08-14 08:36:25 UTC (rev 16756) @@ -421,16 +421,24 @@ static void simple_input_cb(gpointer data, gint source, GaimInputCondition cond); -static void send_later_cb(gpointer data, gint source) { +static void send_later_cb(gpointer data, gint source, const gchar *error) { GaimConnection *gc = data; - struct simple_account_data *sip = gc->proto_data; + struct simple_account_data *sip; struct sip_connection *conn; + if (!GAIM_CONNECTION_IS_VALID(gc)) + { + if (source >= 0) + close(source); + return; + } + if(source < 0) { gaim_connection_error(gc, _("Could not connect")); return; } + sip = gc->proto_data; sip->fd = source; sip->connecting = FALSE; @@ -452,7 +460,7 @@ if(!sip->connecting) { gaim_debug_info("simple", "connecting to %s port %d\n", sip->realhostname ? sip->realhostname : "{NULL}", sip->realport); - connect_info = gaim_proxy_connect(sip->account, sip->realhostname, sip->realport, send_later_cb, NULL, gc); + connect_info = gaim_proxy_connect(sip->account, sip->realhostname, sip->realport, send_later_cb, gc); if(connect_info == NULL) { gaim_connection_error(gc, _("Couldn't create socket")); } @@ -1453,16 +1461,24 @@ conn->inputhandler = gaim_input_add(newfd, GAIM_INPUT_READ, simple_input_cb, gc); } -static void login_cb(gpointer data, gint source) { +static void login_cb(gpointer data, gint source, const gchar *error_message) { GaimConnection *gc = data; - struct simple_account_data *sip = gc->proto_data; + struct simple_account_data *sip; struct sip_connection *conn; + if (!GAIM_CONNECTION_IS_VALID(gc)) + { + if (source >= 0) + close(source); + return; + } + if(source < 0) { gaim_connection_error(gc, _("Could not connect")); return; } + sip = gc->proto_data; sip->fd = source; conn = connection_create(sip, source); @@ -1553,7 +1569,7 @@ sip->realhostname, sip->realport); /* open tcp connection to the server */ connect_info = gaim_proxy_connect(sip->account, sip->realhostname, - sip->realport, login_cb, NULL, sip->gc); + sip->realport, login_cb, sip->gc); if(connect_info == NULL) { gaim_connection_error(sip->gc, _("Couldn't create socket")); } Modified: branches/v2_0_0/src/protocols/toc/toc.c =================================================================== --- branches/v2_0_0/src/protocols/toc/toc.c 2006-08-14 08:32:52 UTC (rev 16755) +++ branches/v2_0_0/src/protocols/toc/toc.c 2006-08-14 08:36:25 UTC (rev 16756) @@ -160,8 +160,9 @@ struct sockaddr_in name; socklen_t namelen; - if (!g_list_find(gaim_connections_get_all(), data)) { - close(source); + if (!GAIM_CONNECTION_IS_VALID(gc)) { + if (source >= 0) + close(source); return; } Modified: branches/v2_0_0/src/protocols/yahoo/yahoo.c =================================================================== --- branches/v2_0_0/src/protocols/yahoo/yahoo.c 2006-08-14 08:32:52 UTC (rev 16755) +++ branches/v2_0_0/src/protocols/yahoo/yahoo.c 2006-08-14 08:36:25 UTC (rev 16756) @@ -2239,7 +2239,7 @@ } } -static void yahoo_got_connected(gpointer data, gint source) +static void yahoo_got_connected(gpointer data, gint source, const gchar *error_message) { GaimConnection *gc = data; struct yahoo_data *yd; @@ -2266,7 +2266,7 @@ gc->inpa = gaim_input_add(yd->fd, GAIM_INPUT_READ, yahoo_pending, gc); } -static void yahoo_got_web_connected(gpointer data, gint source) +static void yahoo_got_web_connected(gpointer data, gint source, const gchar *error_message) { GaimConnection *gc = data; struct yahoo_data *yd; @@ -2348,7 +2348,7 @@ /* Now we have our cookies to login with. I'll go get the milk. */ if (gaim_proxy_connect(account, "wcs2.msg.dcn.yahoo.com", gaim_account_get_int(account, "port", YAHOO_PAGER_PORT), - yahoo_got_web_connected, NULL, gc) == NULL) { + yahoo_got_web_connected, gc) == NULL) { gaim_connection_error(gc, _("Connection problem")); return; } @@ -2390,7 +2390,7 @@ gc->inpa = gaim_input_add(source, GAIM_INPUT_READ, yahoo_web_pending, gc); } -static void yahoo_got_cookies(gpointer data, gint source) +static void yahoo_got_cookies(gpointer data, gint source, const gchar *error_message) { GaimConnection *gc = data; @@ -2516,7 +2516,7 @@ "Host: login.yahoo.com\r\n\r\n"); g_hash_table_destroy(hash); yd->auth = g_string_free(url, FALSE); - if (gaim_proxy_connect(account, "login.yahoo.com", 80, yahoo_got_cookies, NULL, gc) == NULL) { + if (gaim_proxy_connect(account, "login.yahoo.com", 80, yahoo_got_cookies, gc) == NULL) { gaim_connection_error(gc, _("Connection problem")); return; } @@ -2618,7 +2618,7 @@ if (gaim_proxy_connect(account, gaim_account_get_string(account, "serverjp", YAHOOJP_PAGER_HOST), gaim_account_get_int(account, "port", YAHOO_PAGER_PORT), - yahoo_got_connected, NULL, gc) == NULL) + yahoo_got_connected, gc) == NULL) { gaim_connection_error(gc, _("Connection problem")); return; @@ -2628,7 +2628,7 @@ if (gaim_proxy_connect(account, gaim_account_get_string(account, "server", YAHOO_PAGER_HOST), gaim_account_get_int(account, "port", YAHOO_PAGER_PORT), - yahoo_got_connected, NULL, gc) == NULL) + yahoo_got_connected, gc) == NULL) { gaim_connection_error(gc, _("Connection problem")); return; Modified: branches/v2_0_0/src/protocols/yahoo/yahoo_filexfer.c =================================================================== --- branches/v2_0_0/src/protocols/yahoo/yahoo_filexfer.c 2006-08-14 08:32:52 UTC (rev 16755) +++ branches/v2_0_0/src/protocols/yahoo/yahoo_filexfer.c 2006-08-14 08:36:25 UTC (rev 16756) @@ -92,7 +92,7 @@ } -static void yahoo_receivefile_connected(gpointer data, gint source) +static void yahoo_receivefile_connected(gpointer data, gint source, const gchar *error_message) { GaimXfer *xfer; struct yahoo_xfer_data *xd; @@ -162,7 +162,7 @@ gaim_xfer_start(xfer, source, NULL, 0); } -static void yahoo_sendfile_connected(gpointer data, gint source) +static void yahoo_sendfile_connected(gpointer data, gint source, const gchar *error_message) { GaimXfer *xfer; struct yahoo_xfer_data *xd; @@ -263,7 +263,7 @@ if (yd->jp) { if (gaim_proxy_connect(account, gaim_account_get_string(account, "xferjp_host", YAHOOJP_XFER_HOST), gaim_account_get_int(account, "xfer_port", YAHOO_XFER_PORT), - yahoo_sendfile_connected, NULL, xfer) == NULL) + yahoo_sendfile_connected, xfer) == NULL) { gaim_notify_error(gc, NULL, _("File Transfer Failed"), _("Unable to establish file descriptor.")); @@ -272,7 +272,7 @@ } else { if (gaim_proxy_connect(account, gaim_account_get_string(account, "xfer_host", YAHOO_XFER_HOST), gaim_account_get_int(account, "xfer_port", YAHOO_XFER_PORT), - yahoo_sendfile_connected, NULL, xfer) == NULL) + yahoo_sendfile_connected, xfer) == NULL) { gaim_notify_error(gc, NULL, _("File Transfer Failed"), _("Unable to establish file descriptor.")); @@ -282,7 +282,7 @@ } else { /* TODO: Using xfer->fd like this is probably a bad thing... */ if (gaim_proxy_connect(account, xfer_data->host, xfer_data->port, - yahoo_receivefile_connected, NULL, xfer) == NULL) + yahoo_receivefile_connected, xfer) == NULL) xfer->fd = -1; else xfer->fd = 0; Modified: branches/v2_0_0/src/protocols/yahoo/yahoo_picture.c =================================================================== --- branches/v2_0_0/src/protocols/yahoo/yahoo_picture.c 2006-08-14 08:32:52 UTC (rev 16755) +++ branches/v2_0_0/src/protocols/yahoo/yahoo_picture.c 2006-08-14 08:36:25 UTC (rev 16756) @@ -406,7 +406,7 @@ } } -static void yahoo_buddy_icon_upload_connected(gpointer data, gint source) +static void yahoo_buddy_icon_upload_connected(gpointer data, gint source, const gchar *error_message) { struct yahoo_buddy_icon_upload_data *d = data; struct yahoo_packet *pkt; @@ -484,7 +484,7 @@ if (yd->jp) { if (gaim_proxy_connect(account, gaim_account_get_string(account, "xferjp_host", YAHOOJP_XFER_HOST), gaim_account_get_int(account, "xfer_port", YAHOO_XFER_PORT), - yahoo_buddy_icon_upload_connected, NULL, d) == NULL) + yahoo_buddy_icon_upload_connected, d) == NULL) { gaim_debug_error("yahoo", "Uploading our buddy icon failed to connect.\n"); yahoo_buddy_icon_upload_data_free(d); @@ -492,7 +492,7 @@ } else { if (gaim_proxy_connect(account, gaim_account_get_string(account, "xfer_host", YAHOO_XFER_HOST), gaim_account_get_int(account, "xfer_port", YAHOO_XFER_PORT), - yahoo_buddy_icon_upload_connected, NULL, d) == NULL) + yahoo_buddy_icon_upload_connected, d) == NULL) { gaim_debug_error("yahoo", "Uploading our buddy icon failed to connect.\n"); yahoo_buddy_icon_upload_data_free(d); Modified: branches/v2_0_0/src/protocols/yahoo/yahoochat.c =================================================================== --- branches/v2_0_0/src/protocols/yahoo/yahoochat.c 2006-08-14 08:32:52 UTC (rev 16755) +++ branches/v2_0_0/src/protocols/yahoo/yahoochat.c 2006-08-14 08:36:25 UTC (rev 16756) @@ -1373,7 +1373,7 @@ } -static void yahoo_roomlist_got_connected(gpointer data, gint source) +static void yahoo_roomlist_got_connected(gpointer data, gint source, const gchar *error_message) { struct yahoo_roomlist *yrl = data; GaimRoomlist *list = yrl->list; @@ -1450,7 +1450,7 @@ gaim_roomlist_set_fields(rl, fields); if (gaim_proxy_connect(gaim_connection_get_account(gc), yrl->host, 80, - yahoo_roomlist_got_connected, NULL, yrl) == NULL) + yahoo_roomlist_got_connected, yrl) == NULL) { gaim_notify_error(gc, NULL, _("Connection problem"), _("Unable to fetch room list.")); yahoo_roomlist_cleanup(rl, yrl); @@ -1519,7 +1519,7 @@ gaim_roomlist_room_add(list, yrl->ucat); if (gaim_proxy_connect(list->account, yrl->host, 80, - yahoo_roomlist_got_connected, NULL, yrl) == NULL) + yahoo_roomlist_got_connected, yrl) == NULL) { gaim_notify_error(gaim_account_get_connection(list->account), NULL, _("Connection problem"), _("Unable to fetch room list.")); Modified: branches/v2_0_0/src/protocols/yahoo/ycht.c =================================================================== --- branches/v2_0_0/src/protocols/yahoo/ycht.c 2006-08-14 08:32:52 UTC (rev 16755) +++ branches/v2_0_0/src/protocols/yahoo/ycht.c 2006-08-14 08:36:25 UTC (rev 16756) @@ -528,7 +528,7 @@ } } -static void ycht_got_connected(gpointer data, gint source) +static void ycht_got_connected(gpointer data, gint source, const gchar *error_message) { YchtConn *ycht = data; GaimConnection *gc = ycht->gc; @@ -571,7 +571,7 @@ if (gaim_proxy_connect(account, gaim_account_get_string(account, "ycht-server", YAHOO_YCHT_HOST), gaim_account_get_int(account, "ycht-port", YAHOO_YCHT_PORT), - ycht_got_connected, NULL, ycht) == NULL) + ycht_got_connected, ycht) == NULL) { ycht_connection_error(ycht, _("Connection problem")); return; Modified: branches/v2_0_0/src/proxy.c =================================================================== --- branches/v2_0_0/src/proxy.c 2006-08-14 08:32:52 UTC (rev 16755) +++ branches/v2_0_0/src/proxy.c 2006-08-14 08:36:25 UTC (rev 16756) @@ -40,7 +40,6 @@ struct _GaimProxyConnectInfo { GaimProxyConnectFunction connect_cb; - GaimProxyErrorFunction error_cb; gpointer data; char *host; int port; @@ -324,7 +323,7 @@ static void gaim_proxy_connect_info_connected(GaimProxyConnectInfo *connect_info) { - connect_info->connect_cb(connect_info->data, connect_info->fd); + connect_info->connect_cb(connect_info->data, connect_info->fd, NULL); /* * We've passed the file descriptor to the protocol, so it's no longer @@ -348,22 +347,7 @@ static void gaim_proxy_connect_info_error(GaimProxyConnectInfo *connect_info, const gchar *error_message) { - if (connect_info->error_cb == NULL) - { - /* - * TODO - * While we're transitioning to the new gaim_proxy_connect() - * code, not all callers supply an error_cb. If this is the - * case then they're expecting connect_cb to be called with - * an fd of -1 in the case of an error. Once all callers have - * been changed this whole if statement should be removed. - */ - connect_info->connect_cb(connect_info->data, -1); - gaim_proxy_connect_info_destroy(connect_info); - return; - } - - connect_info->error_cb(connect_info->data, error_message); + connect_info->connect_cb(connect_info->data, -1, error_message); gaim_proxy_connect_info_destroy(connect_info); } @@ -2339,8 +2323,7 @@ GaimProxyConnectInfo * gaim_proxy_connect(GaimAccount *account, const char *host, int port, - GaimProxyConnectFunction connect_cb, - GaimProxyErrorFunction error_cb, gpointer data) + GaimProxyConnectFunction connect_cb, gpointer data) { const char *connecthost = host; int connectport = port; @@ -2349,12 +2332,10 @@ g_return_val_if_fail(host != NULL, NULL); g_return_val_if_fail(port > 0, NULL); g_return_val_if_fail(connect_cb != NULL, NULL); - /* g_return_val_if_fail(error_cb != NULL, NULL); *//* TODO: Soon! */ connect_info = g_new0(GaimProxyConnectInfo, 1); connect_info->fd = -1; connect_info->connect_cb = connect_cb; - connect_info->error_cb = error_cb; connect_info->data = data; connect_info->host = g_strdup(host); connect_info->port = port; @@ -2404,20 +2385,17 @@ */ GaimProxyConnectInfo * gaim_proxy_connect_socks5(GaimProxyInfo *gpi, const char *host, int port, - GaimProxyConnectFunction connect_cb, - GaimProxyErrorFunction error_cb, gpointer data) + GaimProxyConnectFunction connect_cb, gpointer data) { GaimProxyConnectInfo *connect_info; g_return_val_if_fail(host != NULL, NULL); g_return_val_if_fail(port > 0, NULL); g_return_val_if_fail(connect_cb != NULL, NULL); - /* g_return_val_if_fail(error_cb != NULL, NULL); *//* TODO: Soon! */ connect_info = g_new0(GaimProxyConnectInfo, 1); connect_info->fd = -1; connect_info->connect_cb = connect_cb; - connect_info->error_cb = error_cb; connect_info->data = data; connect_info->host = g_strdup(host); connect_info->port = port; Modified: branches/v2_0_0/src/proxy.h =================================================================== --- branches/v2_0_0/src/proxy.h 2006-08-14 08:32:52 UTC (rev 16755) +++ branches/v2_0_0/src/proxy.h 2006-08-14 08:36:25 UTC (rev 16756) @@ -58,8 +58,7 @@ typedef struct _GaimProxyConnectInfo GaimProxyConnectInfo; -typedef void (*GaimProxyConnectFunction)(gpointer data, gint source); -typedef void (*GaimProxyErrorFunction)(gpointer dat, const gchar *error_message); +typedef void (*GaimProxyConnectFunction)(gpointer data, gint source, const gchar *error_message); /** * The "hosts" parameter is a linked list containing pairs of @@ -235,9 +234,9 @@ * @param host The destination host. * @param port The destination port. * @param connect_cb The function to call when the connection is - * established. - * @param error_cb The function to call if there is an error while - * establishing the connection. + * established. If the connection failed then + * fd will be -1 and error message will be set + * to something descriptive (hopefully). * @param data User-defined data. * * @return NULL if there was an error, or a reference to a data @@ -246,8 +245,7 @@ */ GaimProxyConnectInfo *gaim_proxy_connect(GaimAccount *account, const char *host, int port, - GaimProxyConnectFunction connect_cb, - GaimProxyErrorFunction error_cb, gpointer data); + GaimProxyConnectFunction connect_cb, gpointer data); /** * Makes a connection through a SOCKS5 proxy. @@ -256,9 +254,9 @@ * @param host The destination host. * @param port The destination port. * @param connect_cb The function to call when the connection is - * established. - * @param error_cb The function to call if there is an error while - * establishing the connection. + * established. If the connection failed then + * fd will be -1 and error message will be set + * to something descriptive (hopefully). * @param data User-defined data. * * @return NULL if there was an error, or a reference to a data @@ -267,8 +265,7 @@ */ GaimProxyConnectInfo *gaim_proxy_connect_socks5(GaimProxyInfo *gpi, const char *host, int port, - GaimProxyConnectFunction connect_cb, - GaimProxyErrorFunction error_cb, gpointer data); + GaimProxyConnectFunction connect_cb, gpointer data); /** * Cancel an in-progress connection attempt. This should be called Modified: branches/v2_0_0/src/sslconn.c =================================================================== --- branches/v2_0_0/src/sslconn.c 2006-08-14 08:32:52 UTC (rev 16755) +++ branches/v2_0_0/src/sslconn.c 2006-08-14 08:36:25 UTC (rev 16756) @@ -95,7 +95,7 @@ gsc->connect_cb = func; gsc->error_cb = error_func; - connect_info = gaim_proxy_connect(account, host, port, ops->connect_cb, NULL, gsc); + connect_info = gaim_proxy_connect(account, host, port, ops->connect_cb, gsc); if (connect_info == NULL) { Modified: branches/v2_0_0/src/upnp.c =================================================================== --- branches/v2_0_0/src/upnp.c 2006-08-14 08:32:52 UTC (rev 16755) +++ branches/v2_0_0/src/upnp.c 2006-08-14 08:36:25 UTC (rev 16756) @@ -780,7 +780,7 @@ } static void -looked_up_internal_ip_cb(gpointer data, gint source) +looked_up_internal_ip_cb(gpointer data, gint source, const gchar *error_message) { if (source) { strncpy(control_info.internalip, @@ -811,7 +811,7 @@ } if(gaim_proxy_connect(NULL, addressOfControl, port, - looked_up_internal_ip_cb, NULL, NULL) == NULL) + looked_up_internal_ip_cb, NULL) == NULL) { gaim_debug_error("upnp", "Get Local IP Connect Failed: Address: %s @@@ Port %d\n", addressOfControl, port); Modified: branches/v2_0_0/src/util.c =================================================================== --- branches/v2_0_0/src/util.c 2006-08-14 08:32:52 UTC (rev 16755) +++ branches/v2_0_0/src/util.c 2006-08-14 08:36:25 UTC (rev 16756) @@ -3367,7 +3367,7 @@ } static void -url_fetch_connect_cb(gpointer url_data, gint source) +url_fetch_connect_cb(gpointer url_data, gint source, const gchar *error_message) { GaimFetchUrlData *gfud; @@ -3446,7 +3446,7 @@ &gfud->website.page, &gfud->website.user, &gfud->website.passwd); if (gaim_proxy_connect(NULL, gfud->website.address, - gfud->website.port, url_fetch_connect_cb, NULL, gfud) == NULL) + gfud->website.port, url_fetch_connect_cb, gfud) == NULL) { destroy_fetch_url_data(gfud); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <the...@us...> - 2006-08-14 08:32:54
|
Revision: 16755 Author: thekingant Date: 2006-08-14 01:32:52 -0700 (Mon, 14 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16755&view=rev Log Message: ----------- Whoops, few more warning fixes Modified Paths: -------------- trunk/src/connection.h trunk/src/ft.c trunk/src/upnp.c trunk/src/util.c Modified: trunk/src/connection.h =================================================================== --- trunk/src/connection.h 2006-08-14 08:27:53 UTC (rev 16754) +++ trunk/src/connection.h 2006-08-14 08:32:52 UTC (rev 16755) @@ -271,6 +271,10 @@ * * @return @c TRUE if gc is valid. */ +/* + * TODO: Eventually this bad boy will be removed, because it is + * a gross fix for a crashy problem. + */ #define GAIM_CONNECTION_IS_VALID(gc) (g_list_find(gaim_connections_get_all(), (gc))) /*@}*/ Modified: trunk/src/ft.c =================================================================== --- trunk/src/ft.c 2006-08-14 08:27:53 UTC (rev 16754) +++ trunk/src/ft.c 2006-08-14 08:32:52 UTC (rev 16755) @@ -911,7 +911,7 @@ } static void -connect_cb(gpointer data, gint source) +connect_cb(gpointer data, gint source, const gchar *error_message) { GaimXfer *xfer = (GaimXfer *)data; Modified: trunk/src/upnp.c =================================================================== --- trunk/src/upnp.c 2006-08-14 08:27:53 UTC (rev 16754) +++ trunk/src/upnp.c 2006-08-14 08:32:52 UTC (rev 16755) @@ -780,7 +780,7 @@ } static void -looked_up_internal_ip_cb(gpointer data, gint source) +looked_up_internal_ip_cb(gpointer data, gint source, const gchar *error_message) { if (source) { strncpy(control_info.internalip, Modified: trunk/src/util.c =================================================================== --- trunk/src/util.c 2006-08-14 08:27:53 UTC (rev 16754) +++ trunk/src/util.c 2006-08-14 08:32:52 UTC (rev 16755) @@ -3367,7 +3367,7 @@ } static void -url_fetch_connect_cb(gpointer url_data, gint source) +url_fetch_connect_cb(gpointer url_data, gint source, const gchar *error_message) { GaimFetchUrlData *gfud; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <the...@us...> - 2006-08-14 08:27:55
|
Revision: 16754 Author: thekingant Date: 2006-08-14 01:27:53 -0700 (Mon, 14 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16754&view=rev Log Message: ----------- Warning fixes for now. Someone (probably me, sigh) will have to change this to use gaim_proxy_connect_cancel() later in the week Modified Paths: -------------- trunk/src/protocols/yahoo/yahoo.c trunk/src/protocols/yahoo/yahoo_filexfer.c trunk/src/protocols/yahoo/yahoo_picture.c trunk/src/protocols/yahoo/yahoochat.c trunk/src/protocols/yahoo/ycht.c Modified: trunk/src/protocols/yahoo/yahoo.c =================================================================== --- trunk/src/protocols/yahoo/yahoo.c 2006-08-14 08:24:30 UTC (rev 16753) +++ trunk/src/protocols/yahoo/yahoo.c 2006-08-14 08:27:53 UTC (rev 16754) @@ -2239,7 +2239,7 @@ } } -static void yahoo_got_connected(gpointer data, gint source) +static void yahoo_got_connected(gpointer data, gint source, const gchar *error_message) { GaimConnection *gc = data; struct yahoo_data *yd; @@ -2266,7 +2266,7 @@ gc->inpa = gaim_input_add(yd->fd, GAIM_INPUT_READ, yahoo_pending, gc); } -static void yahoo_got_web_connected(gpointer data, gint source) +static void yahoo_got_web_connected(gpointer data, gint source, const gchar *error_message) { GaimConnection *gc = data; struct yahoo_data *yd; @@ -2390,7 +2390,7 @@ gc->inpa = gaim_input_add(source, GAIM_INPUT_READ, yahoo_web_pending, gc); } -static void yahoo_got_cookies(gpointer data, gint source) +static void yahoo_got_cookies(gpointer data, gint source, const gchar *error_message) { GaimConnection *gc = data; Modified: trunk/src/protocols/yahoo/yahoo_filexfer.c =================================================================== --- trunk/src/protocols/yahoo/yahoo_filexfer.c 2006-08-14 08:24:30 UTC (rev 16753) +++ trunk/src/protocols/yahoo/yahoo_filexfer.c 2006-08-14 08:27:53 UTC (rev 16754) @@ -92,7 +92,7 @@ } -static void yahoo_receivefile_connected(gpointer data, gint source) +static void yahoo_receivefile_connected(gpointer data, gint source, const gchar *error_message) { GaimXfer *xfer; struct yahoo_xfer_data *xd; @@ -162,7 +162,7 @@ gaim_xfer_start(xfer, source, NULL, 0); } -static void yahoo_sendfile_connected(gpointer data, gint source) +static void yahoo_sendfile_connected(gpointer data, gint source, const gchar *error_message) { GaimXfer *xfer; struct yahoo_xfer_data *xd; Modified: trunk/src/protocols/yahoo/yahoo_picture.c =================================================================== --- trunk/src/protocols/yahoo/yahoo_picture.c 2006-08-14 08:24:30 UTC (rev 16753) +++ trunk/src/protocols/yahoo/yahoo_picture.c 2006-08-14 08:27:53 UTC (rev 16754) @@ -406,7 +406,7 @@ } } -static void yahoo_buddy_icon_upload_connected(gpointer data, gint source) +static void yahoo_buddy_icon_upload_connected(gpointer data, gint source, const gchar *error_message) { struct yahoo_buddy_icon_upload_data *d = data; struct yahoo_packet *pkt; Modified: trunk/src/protocols/yahoo/yahoochat.c =================================================================== --- trunk/src/protocols/yahoo/yahoochat.c 2006-08-14 08:24:30 UTC (rev 16753) +++ trunk/src/protocols/yahoo/yahoochat.c 2006-08-14 08:27:53 UTC (rev 16754) @@ -1373,7 +1373,7 @@ } -static void yahoo_roomlist_got_connected(gpointer data, gint source) +static void yahoo_roomlist_got_connected(gpointer data, gint source, const gchar *error_message) { struct yahoo_roomlist *yrl = data; GaimRoomlist *list = yrl->list; Modified: trunk/src/protocols/yahoo/ycht.c =================================================================== --- trunk/src/protocols/yahoo/ycht.c 2006-08-14 08:24:30 UTC (rev 16753) +++ trunk/src/protocols/yahoo/ycht.c 2006-08-14 08:27:53 UTC (rev 16754) @@ -528,7 +528,7 @@ } } -static void ycht_got_connected(gpointer data, gint source) +static void ycht_got_connected(gpointer data, gint source, const gchar *error_message) { YchtConn *ycht = data; GaimConnection *gc = ycht->gc; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <the...@us...> - 2006-08-14 08:24:31
|
Revision: 16753 Author: thekingant Date: 2006-08-14 01:24:30 -0700 (Mon, 14 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16753&view=rev Log Message: ----------- Whatever, toc doesn't compile anyway. Any objections to remove it? Modified Paths: -------------- trunk/src/protocols/toc/toc.c Modified: trunk/src/protocols/toc/toc.c =================================================================== --- trunk/src/protocols/toc/toc.c 2006-08-14 08:23:26 UTC (rev 16752) +++ trunk/src/protocols/toc/toc.c 2006-08-14 08:24:30 UTC (rev 16753) @@ -160,8 +160,9 @@ struct sockaddr_in name; socklen_t namelen; - if (!g_list_find(gaim_connections_get_all(), data)) { - close(source); + if (!GAIM_CONNECTION_IS_VALID(gc)) { + if (source >= 0) + close(source); return; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <the...@us...> - 2006-08-14 08:23:32
|
Revision: 16752 Author: thekingant Date: 2006-08-14 01:23:26 -0700 (Mon, 14 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16752&view=rev Log Message: ----------- I don't feel like fixing simple right now, so I'm adding some GAIM_CONNECTION_IS_VALID's to tide us over Modified Paths: -------------- trunk/src/protocols/simple/simple.c Modified: trunk/src/protocols/simple/simple.c =================================================================== --- trunk/src/protocols/simple/simple.c 2006-08-14 08:22:39 UTC (rev 16751) +++ trunk/src/protocols/simple/simple.c 2006-08-14 08:23:26 UTC (rev 16752) @@ -421,16 +421,24 @@ static void simple_input_cb(gpointer data, gint source, GaimInputCondition cond); -static void send_later_cb(gpointer data, gint source) { +static void send_later_cb(gpointer data, gint source, const gchar *error) { GaimConnection *gc = data; - struct simple_account_data *sip = gc->proto_data; + struct simple_account_data *sip; struct sip_connection *conn; + if (!GAIM_CONNECTION_IS_VALID(gc)) + { + if (source >= 0) + close(source); + return; + } + if(source < 0) { gaim_connection_error(gc, _("Could not connect")); return; } + sip = gc->proto_data; sip->fd = source; sip->connecting = FALSE; @@ -1453,16 +1461,24 @@ conn->inputhandler = gaim_input_add(newfd, GAIM_INPUT_READ, simple_input_cb, gc); } -static void login_cb(gpointer data, gint source) { +static void login_cb(gpointer data, gint source, const gchar *error_message) { GaimConnection *gc = data; - struct simple_account_data *sip = gc->proto_data; + struct simple_account_data *sip; struct sip_connection *conn; + if (!GAIM_CONNECTION_IS_VALID(gc)) + { + if (source >= 0) + close(source); + return; + } + if(source < 0) { gaim_connection_error(gc, _("Could not connect")); return; } + sip = gc->proto_data; sip->fd = source; conn = connection_create(sip, source); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <the...@us...> - 2006-08-14 08:22:42
|
Revision: 16751 Author: thekingant Date: 2006-08-14 01:22:39 -0700 (Mon, 14 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16751&view=rev Log Message: ----------- This should take care of the silc gaim_proxy_connect()s Modified Paths: -------------- trunk/src/protocols/silc/silc.c trunk/src/protocols/silc/silcgaim.h Modified: trunk/src/protocols/silc/silc.c =================================================================== --- trunk/src/protocols/silc/silc.c 2006-08-14 07:37:11 UTC (rev 16750) +++ trunk/src/protocols/silc/silc.c 2006-08-14 08:22:39 UTC (rev 16751) @@ -141,7 +141,7 @@ } static void -silcgaim_login_connected(gpointer data, gint source) +silcgaim_login_connected(gpointer data, gint source, const gchar *error_message) { GaimConnection *gc = data; SilcGaim sg; @@ -153,20 +153,14 @@ g_return_if_fail(gc != NULL); - if (!GAIM_CONNECTION_IS_VALID(gc)) { - close(source); - return; - } + sg = gc->proto_data; + sg->connect_info = NULL; if (source < 0) { gaim_connection_error(gc, _("Connection failed")); return; } - sg = gc->proto_data; - if (sg == NULL) - return; - client = sg->client; account = sg->account; @@ -363,11 +357,12 @@ gc->proto_data = sg; /* Connect to the SILC server */ - if (gaim_proxy_connect(account, + sg->connect_info = gaim_proxy_connect(account, gaim_account_get_string(account, "server", "silc.silcnet.org"), gaim_account_get_int(account, "port", 706), - silcgaim_login_connected, gc) == NULL) + silcgaim_login_connected, gc); + if (sg->connect_info == NULL) { gaim_connection_error(gc, _("Unable to create connection")); return; @@ -387,6 +382,8 @@ SilcGaim sg = (SilcGaim)context; silc_client_stop(sg->client); silc_client_free(sg->client); + if (sg->connect_info != NULL) + gaim_proxy_connect_cancel(sg->connect_info); #ifdef HAVE_SILCMIME_H if (sg->mimeass) silc_mime_assembler_free(sg->mimeass); Modified: trunk/src/protocols/silc/silcgaim.h =================================================================== --- trunk/src/protocols/silc/silcgaim.h 2006-08-14 07:37:11 UTC (rev 16750) +++ trunk/src/protocols/silc/silcgaim.h 2006-08-14 08:22:39 UTC (rev 16751) @@ -67,6 +67,7 @@ SilcClient client; SilcClientConnection conn; + GaimProxyConnectInfo *connect_info; guint scheduler; GaimConnection *gc; GaimAccount *account; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <the...@us...> - 2006-08-14 07:37:13
|
Revision: 16750 Author: thekingant Date: 2006-08-14 00:37:11 -0700 (Mon, 14 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16750&view=rev Log Message: ----------- Sametime should be good Modified Paths: -------------- trunk/src/protocols/sametime/sametime.c Modified: trunk/src/protocols/sametime/sametime.c =================================================================== --- trunk/src/protocols/sametime/sametime.c 2006-08-14 07:27:41 UTC (rev 16749) +++ trunk/src/protocols/sametime/sametime.c 2006-08-14 07:37:11 UTC (rev 16750) @@ -226,6 +226,7 @@ /** socket fd */ int socket; gint outpa; /* like inpa, but the other way */ + GaimProxyConnectInfo *connect_info; /** circular buffer for outgoing data */ GaimCircBuffer *sock_buf; @@ -310,7 +311,7 @@ /* connection functions */ -static void connect_cb(gpointer data, gint source); +static void connect_cb(gpointer data, gint source, const gchar *error_message); /* ----- session ------ */ @@ -1669,15 +1670,12 @@ /** Callback passed to gaim_proxy_connect when an account is logged in, and if the session logging in receives a redirect message */ -static void connect_cb(gpointer data, gint source) { +static void connect_cb(gpointer data, gint source, const gchar *error_message) { struct mwGaimPluginData *pd = data; GaimConnection *gc = pd->gc; - if(! g_list_find(gaim_connections_get_all(), pd->gc)) { - close(source); - g_return_if_reached(); - } + pd->connect_info = NULL; if(source < 0) { /* connection failed */ @@ -3683,7 +3681,8 @@ gaim_connection_update_progress(gc, _("Connecting"), 1, MW_CONNECT_STEPS); - if(gaim_proxy_connect(account, host, port, connect_cb, pd) == NULL) { + pd->connect_info = gaim_proxy_connect(account, host, port, connect_cb, pd); + if(pd->connect_info == NULL) { gaim_connection_error(gc, _("Unable to connect to host")); } } @@ -3716,6 +3715,11 @@ gc->inpa = 0; } + if(pd->connect_info != NULL) { + gaim_proxy_connect_cancel(pd->connect_info); + pd->connect_info = NULL; + } + /* clean up the rest */ mwGaimPluginData_free(pd); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <the...@us...> - 2006-08-14 07:27:44
|
Revision: 16749 Author: thekingant Date: 2006-08-14 00:27:41 -0700 (Mon, 14 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16749&view=rev Log Message: ----------- Fix a bunch of warnings that I caused. Sorry, I should have compiled before committing. Modified Paths: -------------- trunk/src/protocols/qq/qq_proxy.c trunk/src/protocols/qq/qq_proxy.h trunk/src/protocols/qq/udp_proxy_s5.c Modified: trunk/src/protocols/qq/qq_proxy.c =================================================================== --- trunk/src/protocols/qq/qq_proxy.c 2006-08-14 07:23:11 UTC (rev 16748) +++ trunk/src/protocols/qq/qq_proxy.c 2006-08-14 07:27:41 UTC (rev 16749) @@ -246,7 +246,7 @@ } else { /* connect returns 0 */ gaim_debug(GAIM_DEBUG_INFO, "QQ", "Connected.\n"); fcntl(fd, F_SETFL, 0); - phb->func(phb->data, fd, GAIM_INPUT_READ); + phb->func(phb->data, fd, NULL); } return fd; @@ -255,7 +255,7 @@ /* returns the socket handler, or -1 if there is any error */ static gint _qq_udp_proxy_connect(GaimAccount *account, const gchar *server, - guint16 port, void callback(gpointer, gint, GaimInputCondition), GaimConnection *gc) + guint16 port, void callback(gpointer, gint, const gchar *error_message), GaimConnection *gc) { struct sockaddr_in sin; struct PHB *phb; Modified: trunk/src/protocols/qq/qq_proxy.h =================================================================== --- trunk/src/protocols/qq/qq_proxy.h 2006-08-14 07:23:11 UTC (rev 16748) +++ trunk/src/protocols/qq/qq_proxy.h 2006-08-14 07:27:41 UTC (rev 16749) @@ -31,7 +31,7 @@ #define QQ_CONNECT_STEPS 2 /* steps in connection */ struct PHB { - GaimInputFunction func; + GaimProxyConnectFunction func; gpointer data; gchar *host; gint port; Modified: trunk/src/protocols/qq/udp_proxy_s5.c =================================================================== --- trunk/src/protocols/qq/udp_proxy_s5.c 2006-08-14 07:23:11 UTC (rev 16748) +++ trunk/src/protocols/qq/udp_proxy_s5.c 2006-08-14 07:27:41 UTC (rev 16749) @@ -45,7 +45,7 @@ if (phb->account == NULL || gaim_account_get_connection(phb->account) != NULL) { - phb->func(phb->data, source, GAIM_INPUT_READ); + phb->func(phb->data, source, NULL); } g_free(phb->host); @@ -61,7 +61,7 @@ if (phb->account == NULL || gaim_account_get_connection(phb->account) != NULL) { - phb->func(phb->data, -1, GAIM_INPUT_READ); + phb->func(phb->data, -1, NULL); } g_free(phb->host); @@ -93,7 +93,7 @@ fcntl(phb->udpsock, F_SETFL, 0); if (phb->account == NULL || gaim_account_get_connection(phb->account) != NULL) { - phb->func(phb->data, phb->udpsock, GAIM_INPUT_READ); + phb->func(phb->data, phb->udpsock, NULL); } g_free(phb->host); @@ -158,7 +158,7 @@ gaim_debug(GAIM_DEBUG_INFO, "s5_sendconnect", "packet too small\n"); if (phb->account == NULL || gaim_account_get_connection(phb->account) != NULL) { - phb->func(phb->data, -1, GAIM_INPUT_READ); + phb->func(phb->data, -1, NULL); } g_free(phb->host); @@ -182,7 +182,7 @@ if (phb->account == NULL || gaim_account_get_connection(phb->account) != NULL) { - phb->func(phb->data, -1, GAIM_INPUT_READ); + phb->func(phb->data, -1, NULL); } g_free(phb->host); @@ -195,7 +195,7 @@ if (phb->account == NULL || gaim_account_get_connection(phb->account) != NULL) { - phb->func(phb->data, -1, GAIM_INPUT_READ); + phb->func(phb->data, -1, NULL); } g_free(phb->host); @@ -224,7 +224,7 @@ if (phb->account == NULL || gaim_account_get_connection(phb->account) != NULL) { - phb->func(phb->data, source, GAIM_INPUT_READ); + phb->func(phb->data, source, NULL); } g_free(phb->host); @@ -238,7 +238,7 @@ if (phb->account == NULL || gaim_account_get_connection(phb->account) != NULL) { - phb->func(phb->data, -1, GAIM_INPUT_READ); + phb->func(phb->data, -1, NULL); } g_free(phb->host); @@ -263,7 +263,7 @@ if (phb->account == NULL || gaim_account_get_connection(phb->account) != NULL) { - phb->func(phb->data, -1, GAIM_INPUT_READ); + phb->func(phb->data, -1, NULL); } g_free(phb->host); @@ -297,7 +297,7 @@ close(source); if (phb->account == NULL || gaim_account_get_connection(phb->account) != NULL) { - phb->func(phb->data, -1, GAIM_INPUT_READ); + phb->func(phb->data, -1, NULL); } g_free(phb->host); @@ -327,7 +327,7 @@ if (phb->account == NULL || gaim_account_get_connection(phb->account) != NULL) { - phb->func(phb->data, -1, GAIM_INPUT_READ); + phb->func(phb->data, -1, NULL); } g_free(phb->host); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <the...@us...> - 2006-08-14 07:23:12
|
Revision: 16748 Author: thekingant Date: 2006-08-14 00:23:11 -0700 (Mon, 14 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16748&view=rev Log Message: ----------- I really don't feel like changing qq right now Modified Paths: -------------- trunk/src/protocols/qq/qq_proxy.c Modified: trunk/src/protocols/qq/qq_proxy.c =================================================================== --- trunk/src/protocols/qq/qq_proxy.c 2006-08-14 07:18:58 UTC (rev 16747) +++ trunk/src/protocols/qq/qq_proxy.c 2006-08-14 07:23:11 UTC (rev 16748) @@ -119,7 +119,7 @@ /* the callback function after socket is built * we setup the qq protocol related configuration here */ -static void _qq_got_login(gpointer data, gint source) +static void _qq_got_login(gpointer data, gint source, const gchar *error_message) { qq_data *qd; GaimConnection *gc; @@ -127,13 +127,14 @@ const gchar *passwd; gc = (GaimConnection *) data; - g_return_if_fail(gc != NULL && gc->proto_data != NULL); - if (g_list_find(gaim_connections_get_all(), gc) == NULL) { + if (!GAIM_CONNECTION_IS_VALID(gc)) { close(source); return; } + g_return_if_fail(gc != NULL && gc->proto_data != NULL); + if (source < 0) { /* socket returns -1 */ gaim_connection_error(gc, _("Unable to connect.")); return; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <the...@us...> - 2006-08-14 07:19:00
|
Revision: 16747 Author: thekingant Date: 2006-08-14 00:18:58 -0700 (Mon, 14 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16747&view=rev Log Message: ----------- Jabber is done. Also, I have a feeling JabberSIXfer->streamhosts is leaking, if anyone wants to fix it. Wink wink. Nudge Nudge. Karate chop. Modified Paths: -------------- trunk/src/protocols/jabber/jabber.c trunk/src/protocols/jabber/jabber.h trunk/src/protocols/jabber/si.c Modified: trunk/src/protocols/jabber/jabber.c =================================================================== --- trunk/src/protocols/jabber/jabber.c 2006-08-14 07:00:26 UTC (rev 16746) +++ trunk/src/protocols/jabber/jabber.c 2006-08-14 07:18:58 UTC (rev 16747) @@ -30,6 +30,7 @@ #include "message.h" #include "notify.h" #include "pluginpref.h" +#include "proxy.h" #include "prpl.h" #include "request.h" #include "server.h" @@ -421,21 +422,18 @@ static void -jabber_login_callback(gpointer data, gint source) +jabber_login_callback(gpointer data, gint source, const gchar *error) { GaimConnection *gc = data; JabberStream *js = gc->proto_data; + js->connect_info = NULL; + if (source < 0) { gaim_connection_error(gc, _("Couldn't connect to host")); return; } - if(!g_list_find(gaim_connections_get_all(), gc)) { - close(source); - return; - } - js->fd = source; if(js->state == JABBER_STREAM_CONNECTING) @@ -474,12 +472,10 @@ static void jabber_login_connect(JabberStream *js, const char *server, int port) { - GaimProxyConnectInfo *connect_info; - - connect_info = gaim_proxy_connect(js->gc->account, server, + js->connect_info = gaim_proxy_connect(js->gc->account, server, port, jabber_login_callback, js->gc); - if (connect_info == NULL) + if (js->connect_info == NULL) gaim_connection_error(js->gc, _("Unable to create socket")); } @@ -862,7 +858,6 @@ const char *connect_server = gaim_account_get_string(account, "connect_server", ""); const char *server; - GaimProxyConnectInfo *connect_info; js = gc->proto_data = g_new0(JabberStream, 1); js->gc = gc; @@ -912,11 +907,11 @@ } if(!js->gsc) { - connect_info = gaim_proxy_connect(account, server, + js->connect_info = gaim_proxy_connect(account, server, gaim_account_get_int(account, "port", 5222), jabber_login_callback, gc); - if (connect_info == NULL) + if (js->connect_info == NULL) gaim_connection_error(gc, _("Unable to create socket")); } } @@ -932,6 +927,9 @@ if (!gc->disconnect_timeout) jabber_send_raw(js, "</stream:stream>", -1); + if (js->connect_info) + gaim_proxy_connect_cancel(js->connect_info); + if(js->gsc) { #ifdef HAVE_OPENSSL if (!gc->disconnect_timeout) Modified: trunk/src/protocols/jabber/jabber.h =================================================================== --- trunk/src/protocols/jabber/jabber.h 2006-08-14 07:00:26 UTC (rev 16746) +++ trunk/src/protocols/jabber/jabber.h 2006-08-14 07:18:58 UTC (rev 16747) @@ -67,6 +67,8 @@ { int fd; + GaimProxyConnectInfo *connect_info; + #ifdef HAVE_LIBXML xmlParserCtxt *context; #else Modified: trunk/src/protocols/jabber/si.c =================================================================== --- trunk/src/protocols/jabber/si.c 2006-08-14 07:00:26 UTC (rev 16746) +++ trunk/src/protocols/jabber/si.c 2006-08-14 07:18:58 UTC (rev 16747) @@ -46,6 +46,8 @@ typedef struct _JabberSIXfer { JabberStream *js; + GaimProxyConnectInfo *connect_info; + gboolean accepted; char *stream_id; @@ -88,7 +90,8 @@ static void jabber_si_bytestreams_attempt_connect(GaimXfer *xfer); -static void jabber_si_bytestreams_connect_cb(gpointer data, gint source) +static void +jabber_si_bytestreams_connect_cb(gpointer data, gint source, const gchar *error_message) { GaimXfer *xfer = data; JabberSIXfer *jsx = xfer->data; @@ -97,6 +100,7 @@ struct bytestreams_streamhost *streamhost = jsx->streamhosts->data; gaim_proxy_info_destroy(jsx->gpi); + jsx->connect_info = NULL; if(source < 0) { jsx->streamhosts = g_list_remove(jsx->streamhosts, streamhost); @@ -167,8 +171,18 @@ for(i=0; i<20; i++, p+=2) snprintf(p, 3, "%02x", hashval[i]); - gaim_proxy_connect_socks5(jsx->gpi, dstaddr, 0, jabber_si_bytestreams_connect_cb, xfer); + jsx->connect_info = gaim_proxy_connect_socks5(jsx->gpi, dstaddr, 0, + jabber_si_bytestreams_connect_cb, xfer); g_free(dstaddr); + + if (jsx->connect_info == NULL) + { + jsx->streamhosts = g_list_remove(jsx->streamhosts, streamhost); + g_free(streamhost->jid); + g_free(streamhost->host); + g_free(streamhost); + jabber_si_bytestreams_attempt_connect(xfer); + } } void jabber_bytestreams_parse(JabberStream *js, xmlnode *packet) @@ -682,6 +696,9 @@ js->file_transfers = g_list_remove(js->file_transfers, xfer); + if (jsx->connect_info != NULL) + gaim_proxy_connect_cancel(jsx->connect_info); + g_free(jsx->stream_id); g_free(jsx->iq_id); /* XXX: free other stuff */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <the...@us...> - 2006-08-14 07:00:30
|
Revision: 16746 Author: thekingant Date: 2006-08-14 00:00:26 -0700 (Mon, 14 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16746&view=rev Log Message: ----------- Alright, SVN gaim_proxy_connect()'s are good Modified Paths: -------------- trunk/src/protocols/msn/directconn.c trunk/src/protocols/msn/directconn.h trunk/src/protocols/msn/httpconn.c trunk/src/protocols/msn/httpconn.h trunk/src/protocols/msn/servconn.c trunk/src/protocols/msn/servconn.h Modified: trunk/src/protocols/msn/directconn.c =================================================================== --- trunk/src/protocols/msn/directconn.c 2006-08-14 06:38:12 UTC (rev 16745) +++ trunk/src/protocols/msn/directconn.c 2006-08-14 07:00:26 UTC (rev 16746) @@ -288,11 +288,6 @@ /* ERROR */ gaim_debug_error("msn", "error reading\n"); - if (directconn->inpa) - gaim_input_remove(directconn->inpa); - - close(directconn->fd); - msn_directconn_destroy(directconn); return; @@ -307,11 +302,6 @@ /* ERROR */ gaim_debug_error("msn", "error reading\n"); - if (directconn->inpa) - gaim_input_remove(directconn->inpa); - - close(directconn->fd); - msn_directconn_destroy(directconn); return; @@ -358,17 +348,12 @@ /* ERROR */ gaim_debug_error("msn", "error reading\n"); - if (directconn->inpa) - gaim_input_remove(directconn->inpa); - - close(directconn->fd); - msn_directconn_destroy(directconn); } } static void -connect_cb(gpointer data, gint source) +connect_cb(gpointer data, gint source, const gchar *error_message) { MsnDirectConn* directconn; int fd; @@ -376,6 +361,7 @@ gaim_debug_misc("msn", "directconn: connect_cb: %d\n", source); directconn = data; + directconn->connect_info = NULL; if (TRUE) { @@ -423,7 +409,6 @@ msn_directconn_connect(MsnDirectConn *directconn, const char *host, int port) { MsnSession *session; - GaimProxyConnectInfo *connect_info; g_return_val_if_fail(directconn != NULL, FALSE); g_return_val_if_fail(host != NULL, TRUE); @@ -438,10 +423,10 @@ } #endif - connect_info = gaim_proxy_connect(session->account, host, port, + directconn->connect_info = gaim_proxy_connect(session->account, host, port, connect_cb, directconn); - if (connect_info != NULL) + if (directconn->connect_info != NULL) { return TRUE; } @@ -491,6 +476,15 @@ void msn_directconn_destroy(MsnDirectConn *directconn) { + if (directconn->connect_info != NULL) + gaim_proxy_connect_cancel(directconn->connect_info); + + if (directconn->inpa != 0) + gaim_input_remove(directconn->inpa); + + if (directconn->fd >= 0) + close(directconn->fd); + if (directconn->nonce != NULL) g_free(directconn->nonce); Modified: trunk/src/protocols/msn/directconn.h =================================================================== --- trunk/src/protocols/msn/directconn.h 2006-08-14 06:38:12 UTC (rev 16745) +++ trunk/src/protocols/msn/directconn.h 2006-08-14 07:00:26 UTC (rev 16746) @@ -35,6 +35,8 @@ MsnSlpLink *slplink; MsnSlpCall *initial_call; + GaimProxyConnectInfo *connect_info; + gboolean acked; char *nonce; Modified: trunk/src/protocols/msn/httpconn.c =================================================================== --- trunk/src/protocols/msn/httpconn.c 2006-08-14 06:38:12 UTC (rev 16745) +++ trunk/src/protocols/msn/httpconn.c 2006-08-14 07:00:26 UTC (rev 16746) @@ -693,21 +693,12 @@ } static void -connect_cb(gpointer data, gint source) +connect_cb(gpointer data, gint source, const gchar *error_message) { - MsnHttpConn *httpconn = data; + MsnHttpConn *httpconn; - /* - TODO: Need to do this in case the account is disabled while connecting - if (!g_list_find(gaim_connections_get_all(), gc)) - { - if (source >= 0) - close(source); - destroy_new_conn_data(new_conn_data); - return; - } - */ - + httpconn = data; + httpconn->connect_info = NULL; httpconn->fd = source; if (source >= 0) @@ -729,8 +720,6 @@ gboolean msn_httpconn_connect(MsnHttpConn *httpconn, const char *host, int port) { - GaimProxyConnectInfo *connect_info; - g_return_val_if_fail(httpconn != NULL, FALSE); g_return_val_if_fail(host != NULL, FALSE); g_return_val_if_fail(port > 0, FALSE); @@ -738,10 +727,10 @@ if (httpconn->connected) msn_httpconn_disconnect(httpconn); - connect_info = gaim_proxy_connect(httpconn->session->account, + httpconn->connect_info = gaim_proxy_connect(httpconn->session->account, "gateway.messenger.hotmail.com", 80, connect_cb, httpconn); - if (connect_info != NULL) + if (httpconn->connect_info != NULL) { httpconn->waiting_response = TRUE; httpconn->connected = TRUE; @@ -758,11 +747,18 @@ if (!httpconn->connected) return; + if (httpconn->connect_info != NULL) + { + gaim_proxy_connect_cancel(httpconn->connect_info); + httpconn->connect_info = NULL; + } + if (httpconn->timer) + { gaim_timeout_remove(httpconn->timer); + httpconn->timer = 0; + } - httpconn->timer = 0; - if (httpconn->inpa > 0) { gaim_input_remove(httpconn->inpa); @@ -770,6 +766,7 @@ } close(httpconn->fd); + httpconn->fd = -1; g_free(httpconn->rx_buf); httpconn->rx_buf = NULL; Modified: trunk/src/protocols/msn/httpconn.h =================================================================== --- trunk/src/protocols/msn/httpconn.h 2006-08-14 06:38:12 UTC (rev 16745) +++ trunk/src/protocols/msn/httpconn.h 2006-08-14 07:00:26 UTC (rev 16746) @@ -37,6 +37,8 @@ MsnSession *session; /**< The MSN Session. */ MsnServConn *servconn; /**< The connection object. */ + GaimProxyConnectInfo *connect_info; + char *full_session_id; /**< The full session id. */ char *session_id; /**< The trimmed session id. */ Modified: trunk/src/protocols/msn/servconn.c =================================================================== --- trunk/src/protocols/msn/servconn.c 2006-08-14 06:38:12 UTC (rev 16745) +++ trunk/src/protocols/msn/servconn.c 2006-08-14 07:00:26 UTC (rev 16746) @@ -166,10 +166,12 @@ **************************************************************************/ static void -connect_cb(gpointer data, gint source) +connect_cb(gpointer data, gint source, const gchar *error_message) { - MsnServConn *servconn = data; + MsnServConn *servconn; + servconn = data; + servconn->connect_info = NULL; servconn->processing = FALSE; if (servconn->wasted) @@ -199,7 +201,6 @@ msn_servconn_connect(MsnServConn *servconn, const char *host, int port) { MsnSession *session; - GaimProxyConnectInfo *connect_info; g_return_val_if_fail(servconn != NULL, FALSE); g_return_val_if_fail(host != NULL, FALSE); @@ -232,10 +233,10 @@ return TRUE; } - connect_info = gaim_proxy_connect(session->account, host, port, + servconn->connect_info = gaim_proxy_connect(session->account, host, port, connect_cb, servconn); - if (connect_info != NULL) + if (servconn->connect_info != NULL) { servconn->processing = TRUE; return TRUE; @@ -267,6 +268,12 @@ return; } + if (servconn->connect_info != NULL) + { + gaim_proxy_connect_cancel(servconn->connect_info); + servconn->connect_info = NULL; + } + if (servconn->inpa > 0) { gaim_input_remove(servconn->inpa); Modified: trunk/src/protocols/msn/servconn.h =================================================================== --- trunk/src/protocols/msn/servconn.h 2006-08-14 06:38:12 UTC (rev 16745) +++ trunk/src/protocols/msn/servconn.h 2006-08-14 07:00:26 UTC (rev 16746) @@ -63,6 +63,8 @@ MsnSession *session; /**< The MSN session of this connection. */ MsnCmdProc *cmdproc; /**< The command processor of this connection. */ + GaimProxyConnectInfo *connect_info; + gboolean connected; /**< A flag that states if it's connected. */ gboolean processing; /**< A flag that states if something is working with this connection. */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |