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: <mar...@us...> - 2006-08-08 01:02:59
|
Revision: 16670 Author: markhuetsch Date: 2006-08-07 18:02:56 -0700 (Mon, 07 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16670&view=rev Log Message: ----------- Eliminated calls to bindtextdomain() and bind_textdomain_codeset(), which have already and more appropriately been called in gtkmain.c. Also removed the definition of LOCALEDIR, which is no longer needed. Modified Paths: -------------- trunk/src/protocols/qq/Makefile.am trunk/src/protocols/qq/qq.c Modified: trunk/src/protocols/qq/Makefile.am =================================================================== --- trunk/src/protocols/qq/Makefile.am 2006-08-08 00:27:13 UTC (rev 16669) +++ trunk/src/protocols/qq/Makefile.am 2006-08-08 01:02:56 UTC (rev 16670) @@ -93,7 +93,6 @@ AM_CPPFLAGS = \ -I$(top_srcdir)/src \ -DDATADIR=\"${datadir}\" \ - -DLOCALEDIR=\"${datadir}/locale\" \ -DVERSION=\"$(VERSION)\" \ $(DEBUG_CFLAGS) \ $(GLIB_CFLAGS) \ Modified: trunk/src/protocols/qq/qq.c =================================================================== --- trunk/src/protocols/qq/qq.c 2006-08-08 00:27:13 UTC (rev 16669) +++ trunk/src/protocols/qq/qq.c 2006-08-08 01:02:56 UTC (rev 16670) @@ -963,9 +963,6 @@ { GaimAccountOption *option; - bindtextdomain(PACKAGE, LOCALEDIR); - bind_textdomain_codeset(PACKAGE, "UTF-8"); - option = gaim_account_option_bool_new(_("Login in TCP"), "use_tcp", FALSE); prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rl...@us...> - 2006-08-08 00:27:16
|
Revision: 16669 Author: rlaager Date: 2006-08-07 17:27:13 -0700 (Mon, 07 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16669&view=rev Log Message: ----------- Merge the change to this file from revision 16668. The other changes were to QQ files, which don't exist on this branch. Original commit message: We have gaim_str_has_prefix() to use in place of g_str_has_prefix(). ViewCVS Links: ------------- http://svn.sourceforge.net/gaim/?rev=16668&view=rev Modified Paths: -------------- branches/v2_0_0/src/protocols/bonjour/jabber.c Modified: branches/v2_0_0/src/protocols/bonjour/jabber.c =================================================================== --- branches/v2_0_0/src/protocols/bonjour/jabber.c 2006-08-08 00:25:19 UTC (rev 16668) +++ branches/v2_0_0/src/protocols/bonjour/jabber.c 2006-08-08 00:27:13 UTC (rev 16669) @@ -359,7 +359,7 @@ * using a magic string, but xmlnode won't play nice when just * parsing an end tag */ - if (g_str_has_prefix(message, STREAM_END) || (closed_conversation == TRUE)) { + if (gaim_str_has_prefix(message, STREAM_END) || (closed_conversation == TRUE)) { /* Close the socket, clear the watcher and free memory */ if (bb->conversation != NULL) { close(bb->conversation->socket); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rl...@us...> - 2006-08-08 00:25:27
|
Revision: 16668 Author: rlaager Date: 2006-08-07 17:25:19 -0700 (Mon, 07 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16668&view=rev Log Message: ----------- We have gaim_str_has_prefix() to use in place of g_str_has_prefix(). Modified Paths: -------------- trunk/src/protocols/bonjour/jabber.c trunk/src/protocols/qq/group_find.c trunk/src/protocols/qq/utils.c Modified: trunk/src/protocols/bonjour/jabber.c =================================================================== --- trunk/src/protocols/bonjour/jabber.c 2006-08-07 23:10:37 UTC (rev 16667) +++ trunk/src/protocols/bonjour/jabber.c 2006-08-08 00:25:19 UTC (rev 16668) @@ -359,7 +359,7 @@ * using a magic string, but xmlnode won't play nice when just * parsing an end tag */ - if (g_str_has_prefix(message, STREAM_END) || (closed_conversation == TRUE)) { + if (gaim_str_has_prefix(message, STREAM_END) || (closed_conversation == TRUE)) { /* Close the socket, clear the watcher and free memory */ if (bb->conversation != NULL) { close(bb->conversation->socket); Modified: trunk/src/protocols/qq/group_find.c =================================================================== --- trunk/src/protocols/qq/group_find.c 2006-08-07 23:10:37 UTC (rev 16667) +++ trunk/src/protocols/qq/group_find.c 2006-08-08 00:25:19 UTC (rev 16668) @@ -22,6 +22,7 @@ #include "conversation.h" #include "debug.h" +#include "util.h" #include "group_find.h" #include "group_network.h" @@ -39,7 +40,7 @@ /* if it starts with QQ_NAME_PREFIX, we think it is valid name already * otherwise we think it is nickname and try to find the matching gaim_name */ - if (g_str_has_prefix(who, QQ_NAME_PREFIX) && gaim_name_to_uid(who) > 0) + if (gaim_str_has_prefix(who, QQ_NAME_PREFIX) && gaim_name_to_uid(who) > 0) return (gchar *) who; group = qq_group_find_by_channel(gc, channel); Modified: trunk/src/protocols/qq/utils.c =================================================================== --- trunk/src/protocols/qq/utils.c 2006-08-07 23:10:37 UTC (rev 16667) +++ trunk/src/protocols/qq/utils.c 2006-08-08 00:25:19 UTC (rev 16668) @@ -31,18 +31,11 @@ #include "char_conv.h" #include "debug.h" #include "prefs.h" +#include "util.h" #include "utils.h" #define QQ_NAME_FORMAT "qq-%d" -#if !GLIB_CHECK_VERSION(2, 1, 0) -gint g_str_has_prefix(const gchar *str, const gchar *prefix) -{ - gint len = strlen(prefix); - return !strncmp(str, prefix, len); -} -#endif - gchar *get_name_by_index_str(gchar **array, const gchar *index_str, gint amount) { gint index; @@ -160,7 +153,7 @@ { gchar *p; - g_return_val_if_fail(g_str_has_prefix(name, QQ_NAME_PREFIX), 0); + g_return_val_if_fail(gaim_str_has_prefix(name, QQ_NAME_PREFIX), 0); p = g_strrstr(name, QQ_NAME_PREFIX); return (p == NULL) ? 0 : strtol(p + strlen(QQ_NAME_PREFIX), NULL, 10); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ev...@us...> - 2006-08-07 23:10:47
|
Revision: 16667 Author: evands Date: 2006-08-07 16:10:37 -0700 (Mon, 07 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16667&view=rev Log Message: ----------- Use GLIB_CHECK_VERSION to determine if g_str_has_prefix() is needed. As of glib 2.1.0 it was available. Modified Paths: -------------- trunk/src/protocols/qq/utils.c Modified: trunk/src/protocols/qq/utils.c =================================================================== --- trunk/src/protocols/qq/utils.c 2006-08-07 19:23:42 UTC (rev 16666) +++ trunk/src/protocols/qq/utils.c 2006-08-07 23:10:37 UTC (rev 16667) @@ -35,7 +35,7 @@ #define QQ_NAME_FORMAT "qq-%d" -#ifndef g_str_has_prefix +#if !GLIB_CHECK_VERSION(2, 1, 0) gint g_str_has_prefix(const gchar *str, const gchar *prefix) { gint len = strlen(prefix); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ev...@us...> - 2006-08-07 19:23:46
|
Revision: 16666 Author: evands Date: 2006-08-07 12:23:42 -0700 (Mon, 07 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16666&view=rev Log Message: ----------- When not connecting with "Use TLS (if available)" enabled, it's still possible to reach the JABBER_STREAM_REINITIALIZING connection stage. This is step 4 of the 5-step non-SSL connection process. In this situation, jabber_recv_cb_ssl() won't be called, so the delayed reintialization via js_>reinit being TRUE never occurs. jabber_stream_init() is immediately called in that situation. This may cause the same problems when using libxml which js->reinit was introduced to fix in [16585]. I'm not using libxml, so I couldn't test that... if so, a check against js->reinit and a subsequent jabber_stream_init() call is needed somewhere in the connection path taken when not using SSL. Modified Paths: -------------- trunk/src/protocols/jabber/jabber.c Modified: trunk/src/protocols/jabber/jabber.c =================================================================== --- trunk/src/protocols/jabber/jabber.c 2006-08-07 17:16:54 UTC (rev 16665) +++ trunk/src/protocols/jabber/jabber.c 2006-08-07 19:23:42 UTC (rev 16666) @@ -1011,8 +1011,13 @@ break; case JABBER_STREAM_REINITIALIZING: gaim_connection_update_progress(js->gc, _("Re-initializing Stream"), - 6, JABBER_CONNECT_STEPS); - js->reinit = TRUE; + (js->gsc ? 7 : 4), JABBER_CONNECT_STEPS); + if (js->gsc) { + /* The stream will be reinitialized later, in jabber_recv_cb_ssl() */ + js->reinit = TRUE; + } else { + jabber_stream_init(js); + } break; case JABBER_STREAM_CONNECTED: jabber_roster_request(js); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2006-08-07 17:16:58
|
Revision: 16665 Author: markhuetsch Date: 2006-08-07 10:16:54 -0700 (Mon, 07 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16665&view=rev Log Message: ----------- Replaced a call to gaim_gtk_roomlist_dialog_show with gaim_roomlist_show_with_account. Modified Paths: -------------- trunk/src/protocols/qq/qq.c Modified: trunk/src/protocols/qq/qq.c =================================================================== --- trunk/src/protocols/qq/qq.c 2006-08-07 08:30:36 UTC (rev 16664) +++ trunk/src/protocols/qq/qq.c 2006-08-07 17:16:54 UTC (rev 16665) @@ -28,11 +28,11 @@ #include "accountopt.h" #include "debug.h" -#include "gtkroomlist.h" #include "notify.h" #include "prefs.h" #include "prpl.h" #include "request.h" +#include "roomlist.h" #include "server.h" #include "util.h" @@ -507,9 +507,9 @@ g_string_free(info, TRUE); } -static void _qq_menu_search_or_add_permanent_group(GaimPluginAction * action) +static void _qq_menu_search_or_add_permanent_group(GaimPluginAction *action) { - gaim_gtk_roomlist_dialog_show(); + gaim_roomlist_show_with_account(NULL); } /* This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2006-08-07 08:30:41
|
Revision: 16664 Author: markhuetsch Date: 2006-08-07 01:30:36 -0700 (Mon, 07 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16664&view=rev Log Message: ----------- Removed code for looking up specific Chinese geolocation info from a user's IP address. The code was defunct for two reasons: First, the file holding the geolocation data (QQWry.dat) was simply too large to package with Gaim. Second, the current version of QQ seems to have stopped broadcasting the user's IP address with his/her status. Modified Paths: -------------- trunk/src/protocols/qq/Makefile.am trunk/src/protocols/qq/Makefile.mingw trunk/src/protocols/qq/qq.c Removed Paths: ------------- trunk/src/protocols/qq/ip_location.c trunk/src/protocols/qq/ip_location.h Modified: trunk/src/protocols/qq/Makefile.am =================================================================== --- trunk/src/protocols/qq/Makefile.am 2006-08-07 07:39:00 UTC (rev 16663) +++ trunk/src/protocols/qq/Makefile.am 2006-08-07 08:30:36 UTC (rev 16664) @@ -50,8 +50,6 @@ header_info.h \ im.c \ im.h \ - ip_location.c \ - ip_location.h \ keep_alive.c \ keep_alive.h \ login_logout.c \ Modified: trunk/src/protocols/qq/Makefile.mingw =================================================================== --- trunk/src/protocols/qq/Makefile.mingw 2006-08-07 07:39:00 UTC (rev 16663) +++ trunk/src/protocols/qq/Makefile.mingw 2006-08-07 08:30:36 UTC (rev 16664) @@ -95,7 +95,6 @@ group_search.c \ header_info.c \ im.c \ - ip_location.c \ keep_alive.c \ login_logout.c \ packet_parse.c \ Deleted: trunk/src/protocols/qq/ip_location.c =================================================================== --- trunk/src/protocols/qq/ip_location.c 2006-08-07 07:39:00 UTC (rev 16663) +++ trunk/src/protocols/qq/ip_location.c 2006-08-07 08:30:36 UTC (rev 16664) @@ -1,240 +0,0 @@ -/** - * The QQ2003C protocol plugin - * - * for gaim - * - * Copyright (C) 2004 Puzzlebird - * - * 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 USA - * - * This code is based on - * * qqwry.c, by lvxiang <sr...@16...> - * * IpChecker.m, by Jeff_Ye - */ - -#include "internal.h" -#include <string.h> -#include "debug.h" -#include "prefs.h" - -#include "utils.h" -#include "ip_location.h" - -#define DEFAULT_IP_LOCATION_FILE "gaim/QQWry.dat" - -typedef struct _ip_finder ip_finder; - -/* all offset is based the begining of the file */ -struct _ip_finder { - guint32 offset_first_start_ip; /* first abs offset of start ip */ - guint32 offset_last_start_ip; /* last abs offset of start ip */ - guint32 cur_start_ip; /* start ip of current search range */ - guint32 cur_end_ip; /* end ip of current search range */ - guint32 offset_cur_end_ip; /* where is the current end ip saved */ - GIOChannel *io; /* IO Channel to read file */ -}; /* struct _ip_finder */ - -/* convert 1-4 bytes array to integer. - * Small endian (higher bytes in lower place) */ -static guint32 _byte_array_to_int(guint8 *ip, gint count) -{ - guint32 ret, i; - g_return_val_if_fail(count >= 1 && count <= 4, 0); - ret = ip[0]; - for (i = 0; i < count; i++) - ret |= ((guint32) ip[i]) << (8 * i); - return ret; -} - -/* read len of bytes to buf, from io at offset */ -static void _read_from(GIOChannel *io, guint32 offset, guint8 *buf, gint len) -{ - GError *err; - GIOStatus status; - - err = NULL; - status = g_io_channel_seek_position(io, offset, G_SEEK_SET, &err); - if (err != NULL) { - gaim_debug(GAIM_DEBUG_ERROR, "QQ", "Fail seek file @offset[%d]: %s", offset, err->message); - g_error_free(err); - memset(buf, 0, len); - return; - } - - status = g_io_channel_read_chars(io, buf, len, NULL, &err); - if (err != NULL) { - gaim_debug(GAIM_DEBUG_ERROR, "QQ", "Fail read %d bytes from file: %s", len, err->message); - g_error_free(err); - memset(buf, 0, len); - return; - } -} - -/* read len of bytes to buf, from io at offset */ -static gsize _read_line_from(GIOChannel *io, guint32 offset, gchar **ret_str) -{ - gsize bytes_read; - GError *err; - GIOStatus status; - - err = NULL; - status = g_io_channel_seek_position(io, offset, G_SEEK_SET, &err); - if (err != NULL) { - gaim_debug(GAIM_DEBUG_ERROR, "QQ", "Fail seek file @offset[%d]: %s", offset, err->message); - g_error_free(err); - ret_str = NULL; - return -1; - } - - status = g_io_channel_read_line(io, ret_str, &bytes_read, NULL, &err); - if (err != NULL) { - gaim_debug(GAIM_DEBUG_ERROR, "QQ", "Fail read from file: %s", err->message); - g_error_free(err); - ret_str = NULL; - return -1; - } - - return bytes_read; -} - -/* read the string from io, at offset, it may jump several times - * returns the offset of next readable string for area */ -static guint32 _get_string(GIOChannel *io, guint32 offset, gchar **ret) -{ - guint8 *buf; - g_return_val_if_fail(io != NULL, 0); - - buf = g_new0(guint8, 3); - _read_from(io, offset, buf, 1); - - switch (buf[0]) { /* fixed by bluestar11 at gmail dot com, 04/12/20 */ - case 0x01: /* jump together */ - _read_from(io, offset + 1, buf, 3); - return _get_string(io, _byte_array_to_int(buf, 3), ret); - case 0x02: /* jump separately */ - _read_from(io, offset + 1, buf, 3); - _get_string(io, _byte_array_to_int(buf, 3), ret); - return offset + 4; - default: - _read_line_from(io, offset, ret); - return offset + strlen(*ret) + 1; - } -} - -/* extract country and area starting from offset */ -static void _get_country_city(GIOChannel *io, guint32 offset, gchar **country, gchar **area) -{ - guint32 next_offset; - g_return_if_fail(io != NULL); - - next_offset = _get_string(io, offset, country); - if (next_offset == 0) - *area = g_strdup(""); - else - _get_string(io, next_offset, area); -} - -/* set start_ip and end_ip of current range */ -static void _set_ip_range(gint rec_no, ip_finder *f) -{ - guint8 *buf; - guint32 offset; - - g_return_if_fail(f != NULL); - - buf = g_newa(guint8, 7); - offset = f->offset_first_start_ip + rec_no * 7; - - _read_from(f->io, offset, buf, 7); - f->cur_start_ip = _byte_array_to_int(buf, 4); - f->offset_cur_end_ip = _byte_array_to_int(buf + 4, 3); - - _read_from(f->io, f->offset_cur_end_ip, buf, 4); - f->cur_end_ip = _byte_array_to_int(buf, 4); -} - -/* set the country and area for given IP. - * country and area needs to be freed later */ -gboolean qq_ip_get_location(guint32 ip, gchar **country, gchar **area) -{ - gint rec, record_count, B, E; - guint8 *buf; - gchar *addr_file; - ip_finder *f; - GError *err; - const char *ip_fn; - - if (ip == 0) - return FALSE; - - f = g_new0(ip_finder, 1); - err = NULL; - ip_fn = gaim_prefs_get_string("/plugins/prpl/qq/ipfile"); - if (ip_fn == NULL || strlen(ip_fn) == 0 || strncmp(ip_fn, "(null)", strlen("(null)")) == 0) { - addr_file = g_build_filename(DATADIR, DEFAULT_IP_LOCATION_FILE, NULL); - } else { - addr_file = g_build_filename(ip_fn, NULL); - } - - f->io = g_io_channel_new_file(addr_file, "r", &err); - g_free(addr_file); - if (err != NULL) { - gaim_debug(GAIM_DEBUG_ERROR, "QQ", "Unable to open (%s): %s\n", addr_file, err->message); - g_error_free(err); - return FALSE; - } else { - g_io_channel_set_encoding(f->io, NULL, NULL); /* set binary */ - } - - buf = g_newa(guint8, 4); - - _read_from(f->io, 0, buf, 4); - f->offset_first_start_ip = _byte_array_to_int(buf, 4); - _read_from(f->io, 4, buf, 4); - f->offset_last_start_ip = _byte_array_to_int(buf, 4); - - record_count = (f->offset_last_start_ip - f->offset_first_start_ip) / 7; - if (record_count <= 1) { - gaim_debug(GAIM_DEBUG_ERROR, "QQ", "File data error, no records found\n"); - g_io_channel_shutdown(f->io, FALSE, NULL); - return FALSE;; - } - /* search for right range */ - B = 0; - E = record_count; - while (B < E - 1) { - rec = (B + E) / 2; - _set_ip_range(rec, f); - if (ip == f->cur_start_ip) { - B = rec; - break; - } - if (ip > f->cur_start_ip) - B = rec; - else - E = rec; - } - _set_ip_range(B, f); - - if (f->cur_start_ip <= ip && ip <= f->cur_end_ip) { - _get_country_city(f->io, f->offset_cur_end_ip + 4, country, area); - } else { /* not in this range... miss */ - *country = g_strdup("unkown"); - *area = g_strdup(" "); - } /* if ip_start<=ip<=ip_end */ - - g_io_channel_shutdown(f->io, FALSE, NULL); - return TRUE; -} Deleted: trunk/src/protocols/qq/ip_location.h =================================================================== --- trunk/src/protocols/qq/ip_location.h 2006-08-07 07:39:00 UTC (rev 16663) +++ trunk/src/protocols/qq/ip_location.h 2006-08-07 08:30:36 UTC (rev 16664) @@ -1,30 +0,0 @@ -/** - * The QQ2003C protocol plugin - * - * for gaim - * - * Copyright (C) 2004 Puzzlebird - * - * 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 USA - */ - -#ifndef _QQ_IP_LOCATION_H_ -#define _QQ_IP_LOCATION_H_ - -#include "glib.h" - -gboolean qq_ip_get_location(guint32 ip, gchar **country, gchar **city); - -#endif Modified: trunk/src/protocols/qq/qq.c =================================================================== --- trunk/src/protocols/qq/qq.c 2006-08-07 07:39:00 UTC (rev 16663) +++ trunk/src/protocols/qq/qq.c 2006-08-07 08:30:36 UTC (rev 16664) @@ -48,7 +48,6 @@ #include "group_opt.h" #include "header_info.h" #include "im.h" -#include "ip_location.h" #include "keep_alive.h" #include "login_logout.h" #include "packet_parse.h" @@ -245,21 +244,10 @@ if (GAIM_BUDDY_IS_ONLINE(b) && q_bud != NULL) { - /* - ip_value = ntohl(*(guint32 *) (q_bud->ip)); - if (qq_ip_get_location(ip_value, &country, &city)) { - country_utf8 = qq_to_utf8(country, QQ_CHARSET_DEFAULT); - city_utf8 = qq_to_utf8(city, QQ_CHARSET_DEFAULT); - g_string_append_printf(tooltip, "\n%s, %s", country_utf8, city_utf8); - g_free(country); - g_free(city); - g_free(country_utf8); - g_free(city_utf8); - } - */ ip_str = gen_ip_str(q_bud->ip); if (strlen(ip_str) != 0) { - g_string_append_printf(tooltip, "\n<b>%s Address:</b> %s:%d", (q_bud->comm_flag & QQ_COMM_FLAG_TCP_MODE) + g_string_append_printf(tooltip, "\n<b>%s Address:</b> %s:%d", + (q_bud->comm_flag & QQ_COMM_FLAG_TCP_MODE) ? "TCP" : "UDP", ip_str, q_bud->port); } g_free(ip_str); @@ -519,74 +507,6 @@ g_string_free(info, TRUE); } -/* -static void _qq_menu_locate_ip_cb(GaimConnection * gc, GaimRequestFields * fields) -{ - GList *groups, *flds; - GaimRequestField *field; - const gchar *id, *value; - gchar *ip_str = NULL, *ip_dupstr = NULL; - guint8 *ip; - gchar *country, *country_utf8, *city, *city_utf8; - guint32 ip_value; - - for (groups = gaim_request_fields_get_groups(fields); groups && !ip_str; groups = groups->next) { - for (flds = gaim_request_field_group_get_fields(groups->data); flds && !ip_str; flds = flds->next) { - field = flds->data; - id = gaim_request_field_get_id(field); - value = gaim_request_field_string_get_value(field); - - if (!g_ascii_strcasecmp(id, "ip")) { - ip_str = g_strdup(value); - break; - } - } - } - - if(ip_str) { - ip = str_ip_gen(ip_str); - ip_dupstr = gen_ip_str(ip); - - ip_value = ntohl(*(guint32 *)ip); - if (qq_ip_get_location(ip_value, &country, &city)) { - country_utf8 = qq_to_utf8(country, QQ_CHARSET_DEFAULT); - city_utf8 = qq_to_utf8(city, QQ_CHARSET_DEFAULT); - gaim_notify_info(gc, ip_dupstr, country_utf8, city_utf8); - g_free(country); - g_free(city); - g_free(country_utf8); - g_free(city_utf8); - } - else - gaim_notify_info(gc, ip_dupstr, "IP not found", NULL); - g_free(ip); - g_free(ip_dupstr); - g_free(ip_str); - } -} - -static void _qq_menu_locate_ip(GaimPluginAction *action) -{ - GaimConnection *gc = (GaimConnection *) action->context; - GaimRequestField *field; - GaimRequestFields *fields; - GaimRequestFieldGroup *group; - - g_return_if_fail(gc != NULL); - - fields = gaim_request_fields_new(); - group = gaim_request_field_group_new(NULL); - gaim_request_fields_add_group(fields, group); - - field = gaim_request_field_string_new("ip", _("IP Address"), NULL, FALSE); - gaim_request_field_group_add_field(group, field); - - gaim_request_fields(gc, _("Locate an IP"), - _("Locate an IP address"), NULL, fields, - _("Check"), G_CALLBACK(_qq_menu_locate_ip_cb), _("Cancel"), NULL, gc); -} -*/ - static void _qq_menu_search_or_add_permanent_group(GaimPluginAction * action) { gaim_gtk_roomlist_dialog_show(); @@ -847,11 +767,6 @@ m = g_list_append(m, act); */ - /* XXX consider re-enabling this - act = gaim_plugin_action_new(_("Locate an IP"), _qq_menu_locate_ip); - m = g_list_append(m, act); - */ - return m; } @@ -1066,7 +981,6 @@ my_protocol = plugin; gaim_prefs_add_none("/plugins/prpl/qq"); - gaim_prefs_add_string("/plugins/prpl/qq/ipfile", ""); gaim_prefs_add_bool("/plugins/prpl/qq/show_status_by_icon", TRUE); gaim_prefs_add_bool("/plugins/prpl/qq/show_fake_video", FALSE); gaim_prefs_add_string("/plugins/prpl/qq/datadir", DATADIR); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2006-08-07 07:39:05
|
Revision: 16663 Author: markhuetsch Date: 2006-08-07 00:39:00 -0700 (Mon, 07 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16663&view=rev Log Message: ----------- Eliminated some warnings. Modified Paths: -------------- trunk/src/protocols/qq/buddy_list.c trunk/src/protocols/qq/group_im.c trunk/src/protocols/qq/group_join.c trunk/src/protocols/qq/group_opt.c Modified: trunk/src/protocols/qq/buddy_list.c =================================================================== --- trunk/src/protocols/qq/buddy_list.c 2006-08-07 06:17:13 UTC (rev 16662) +++ trunk/src/protocols/qq/buddy_list.c 2006-08-07 07:39:00 UTC (rev 16663) @@ -413,7 +413,7 @@ } else { /* a group */ group = qq_group_find_by_internal_group_id(gc, uid); if(group == NULL) { - /* not working + /*XXX not working group = qq_group_create_by_id(gc, uid, 0); qq_send_cmd_group_get_group_info(gc, group); */ Modified: trunk/src/protocols/qq/group_im.c =================================================================== --- trunk/src/protocols/qq/group_im.c 2006-08-07 06:17:13 UTC (rev 16662) +++ trunk/src/protocols/qq/group_im.c 2006-08-07 07:39:00 UTC (rev 16663) @@ -45,7 +45,7 @@ guint16 msg_seq; time_t send_time; guint16 msg_len; - guint8 *msg; + gchar *msg; guint8 *font_attr; gint font_attr_len; } qq_recv_group_im; @@ -54,7 +54,7 @@ void qq_send_packet_group_im(GaimConnection *gc, qq_group *group, const gchar *msg) { gint data_len, bytes; - guint8 *raw_data, *cursor; + guint8 *raw_data, *cursor, *send_im_tail; guint16 msg_len; gchar *msg_filtered; @@ -70,11 +70,11 @@ bytes += create_packet_b(raw_data, &cursor, QQ_GROUP_CMD_SEND_MSG); bytes += create_packet_dw(raw_data, &cursor, group->internal_group_id); bytes += create_packet_w(raw_data, &cursor, msg_len + QQ_SEND_IM_AFTER_MSG_LEN); - bytes += create_packet_data(raw_data, &cursor, (gchar *) msg_filtered, msg_len); - guint8 *send_im_tail = qq_get_send_im_tail(NULL, NULL, NULL, + bytes += create_packet_data(raw_data, &cursor, (guint8 *) msg_filtered, msg_len); + send_im_tail = qq_get_send_im_tail(NULL, NULL, NULL, FALSE, FALSE, FALSE, QQ_SEND_IM_AFTER_MSG_LEN); - bytes += create_packet_data(raw_data, &cursor, (gchar *) send_im_tail, QQ_SEND_IM_AFTER_MSG_LEN); + bytes += create_packet_data(raw_data, &cursor, send_im_tail, QQ_SEND_IM_AFTER_MSG_LEN); g_free(send_im_tail); g_free(msg_filtered); @@ -296,8 +296,8 @@ } /* recv an IM from a group chat */ -void qq_process_recv_group_im - (guint8 *data, guint8 **cursor, gint data_len, guint32 internal_group_id, GaimConnection *gc, guint16 im_type) +void qq_process_recv_group_im(guint8 *data, guint8 **cursor, gint data_len, + guint32 internal_group_id, GaimConnection *gc, guint16 im_type) { gchar *msg_with_gaim_smiley, *msg_utf8_encoded, *im_src_name; guint16 unknown; @@ -362,7 +362,7 @@ skip_len = 0; *cursor += skip_len; - im_group->msg = g_strdup(*cursor); + im_group->msg = g_strdup((gchar *) *cursor); *cursor += strlen(im_group->msg) + 1; /* there might not be any font_attr, check it */ im_group->font_attr_len = im_group->msg_len - strlen(im_group->msg) - 1 - skip_len; Modified: trunk/src/protocols/qq/group_join.c =================================================================== --- trunk/src/protocols/qq/group_join.c 2006-08-07 06:17:13 UTC (rev 16662) +++ trunk/src/protocols/qq/group_join.c 2006-08-07 07:39:00 UTC (rev 16663) @@ -154,7 +154,7 @@ bytes += create_packet_b(raw_data, &cursor, opt); bytes += create_packet_dw(raw_data, &cursor, uid); bytes += create_packet_b(raw_data, &cursor, strlen(reason_qq)); - bytes += create_packet_data(raw_data, &cursor, reason_qq, strlen(reason_qq)); + bytes += create_packet_data(raw_data, &cursor, (guint8 *) reason_qq, strlen(reason_qq)); if (bytes != data_len) gaim_debug(GAIM_DEBUG_ERROR, "QQ", @@ -335,7 +335,6 @@ } } -/*****************************************************************************/ void qq_group_exit(GaimConnection *gc, GHashTable *data) { gchar *internal_group_id_ptr; Modified: trunk/src/protocols/qq/group_opt.c =================================================================== --- trunk/src/protocols/qq/group_opt.c 2006-08-07 06:17:13 UTC (rev 16662) +++ trunk/src/protocols/qq/group_opt.c 2006-08-07 07:39:00 UTC (rev 16663) @@ -37,6 +37,7 @@ #include "qq.h" #include "utils.h" +/* TODO: can't we use qsort here? */ /* This implement quick sort algorithm (low->high) */ static void _quick_sort(gint *numbers, gint left, gint right) { @@ -228,7 +229,6 @@ gaim_notify_info(gc, _("QQ Qun Operation"), _("You have successfully modify Qun member"), NULL); } -/*****************************************************************************/ void qq_group_modify_info(GaimConnection *gc, qq_group *group) { gint data_len, data_written; @@ -262,15 +262,15 @@ data_written += create_packet_w(data, &cursor, group->group_category); data_written += create_packet_b(data, &cursor, strlen(group_name)); - data_written += create_packet_data(data, &cursor, group_name, strlen(group_name)); + data_written += create_packet_data(data, &cursor, (guint8 *) group_name, strlen(group_name)); data_written += create_packet_w(data, &cursor, 0x0000); data_written += create_packet_b(data, &cursor, strlen(notice)); - data_written += create_packet_data(data, &cursor, notice, strlen(notice)); + data_written += create_packet_data(data, &cursor, (guint8 *) notice, strlen(notice)); data_written += create_packet_b(data, &cursor, strlen(group_desc)); - data_written += create_packet_data(data, &cursor, group_desc, strlen(group_desc)); + data_written += create_packet_data(data, &cursor, (guint8 *) group_desc, strlen(group_desc)); if (data_written != data_len) gaim_debug(GAIM_DEBUG_ERROR, "QQ", @@ -326,7 +326,7 @@ data_written += create_packet_w(data, &cursor, 0x0003); /* 007 */ data_written += create_packet_b(data, &cursor, strlen(name)); - data_written += create_packet_data(data, &cursor, (gchar *) name, strlen(name)); + data_written += create_packet_data(data, &cursor, (guint8 *) name, strlen(name)); data_written += create_packet_w(data, &cursor, 0x0000); data_written += create_packet_b(data, &cursor, 0x00); /* no group notice */ data_written += create_packet_b(data, &cursor, 0x00); /* no group desc */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2006-08-07 06:17:18
|
Revision: 16662 Author: markhuetsch Date: 2006-08-06 23:17:13 -0700 (Sun, 06 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16662&view=rev Log Message: ----------- Enhanced protocol testing tools, primarily by designing a more useful interface for sending customized packets. Modified Paths: -------------- trunk/src/protocols/qq/qq.c trunk/src/protocols/qq/recv_core.c trunk/src/protocols/qq/send_core.h trunk/src/protocols/qq/utils.c trunk/src/protocols/qq/utils.h Modified: trunk/src/protocols/qq/qq.c =================================================================== --- trunk/src/protocols/qq/qq.c 2006-08-07 03:24:39 UTC (rev 16661) +++ trunk/src/protocols/qq/qq.c 2006-08-07 06:17:13 UTC (rev 16662) @@ -28,6 +28,7 @@ #include "accountopt.h" #include "debug.h" +#include "gtkroomlist.h" #include "notify.h" #include "prefs.h" #include "prpl.h" @@ -586,12 +587,10 @@ } */ -/* static void _qq_menu_search_or_add_permanent_group(GaimPluginAction * action) { gaim_gtk_roomlist_dialog_show(); } -*/ /* static void _qq_menu_create_permanent_group(GaimPluginAction * action) @@ -659,57 +658,160 @@ // } } */ -/* -static void _qq_send_custom_packet(GaimConnection *gc, const gchar *packet) + +static gboolean _qq_parse_custom_packet_field(GaimRequestFields *fields, + const gchar *id, guint8 **value) { - guint16 cmd; - guint8 *buffer; - gint len; + GaimRequestField *field; + const gchar *str; + gint len, i; + gboolean success; - if (!packet) { - gaim_debug(GAIM_DEBUG_ERROR, "QQ", "Null packet inputted!\n"); - return; + success = FALSE; + field = gaim_request_fields_get_field(fields, id); + str = gaim_request_field_string_get_value(field); + if (str) { + success = TRUE; + if (strcmp(id, "uid") != 0) { + *value = hex_str_to_bytes(str, &len); + if (!*value || len != 2) + success = FALSE; + } else { + for (i = 0; i < strlen(str); i++) { + if (!g_ascii_isdigit(str[i])) { + success = FALSE; + break; + } + } + if (success) { + *(guint32 *) value = strtoul(str, NULL, 10); + if (errno == ERANGE) + success = FALSE; + } + } } - if (strlen(packet) > MAX_PACKET_SIZE * 2) { - gaim_debug(GAIM_DEBUG_ERROR, "QQ", "Packet inputted is too large!\n"); - return; + if (!success) + gaim_debug(GAIM_DEBUG_ERROR, "QQ", "Invalid entry: %s\n", id); + return success; +} + +static gboolean _qq_parse_custom_packet_fields(GaimRequestFields *fields, + guint8 **client, guint8 **cmd, guint8 **seq, guint32 *uid, + guint8 **body, gint *body_len) +{ + GaimRequestField *field; + gboolean success; + + success = TRUE; + *client = *cmd = *seq = *body = NULL; + *uid = 0; + success = _qq_parse_custom_packet_field(fields, "client", client); + if (success) + success = _qq_parse_custom_packet_field(fields, "cmd", cmd); + if (success) + success = _qq_parse_custom_packet_field(fields, "uid", (guint8 **) uid); + if (success) + success = _qq_parse_custom_packet_field(fields, "seq", seq); + if (success) { + field = gaim_request_fields_get_field(fields, "body"); + *body = hex_str_to_bytes(gaim_request_field_string_get_value(field), + body_len); + } else { + if (*client) + g_free(*client); + if (*cmd) + g_free(*cmd); + if (*seq) + g_free(*seq); } - if (strlen(packet) < 4) { - gaim_debug(GAIM_DEBUG_ERROR, "QQ", "Packet is impossibly short!\n"); - return; - } + return success; +} - buffer = hex_str_to_bytes(packet); - if (!buffer) { - gaim_debug(GAIM_DEBUG_ERROR, "QQ", "Invalid packet inputted!\n"); +static void _qq_send_custom_packet_cb(GaimConnection *gc, GaimRequestFields *fields) +{ + guint32 uid; + guint8 *buf, *client, *cmd, *seq, *body, *cursor; + gint bytes, len; + qq_data *qd; + gboolean success; + + qd = (qq_data *) gc->proto_data; + + success = _qq_parse_custom_packet_fields(fields, &client, &cmd, + &seq, &uid, &body, &len); + if (!success) { + gaim_notify_error(gc, _("Error"), _("Invalid packet entry"), NULL); return; } - // big endian - cmd = 256 * buffer[0] + buffer[1]; - gaim_debug(GAIM_DEBUG_INFO, "QQ", "Inputted CMD: %d\n", cmd); - len = strlen(buffer) - 2; - packet = buffer + 2; + if (body) + g_return_if_fail(len+12 <= MAX_PACKET_SIZE); - qq_send_cmd(gc, cmd, TRUE, 0, TRUE, packet, len); + bytes = 0; + buf = g_newa(guint8, MAX_PACKET_SIZE); + cursor = buf; + /* QQ TCP packet has two bytes in the beginning to define packet length + * so I leave room here for size */ + if (qd->use_tcp) + bytes += create_packet_w(buf, &cursor, 0x0000); + bytes += create_packet_b(buf, &cursor, QQ_PACKET_TAG); + bytes += create_packet_w(buf, &cursor, *(guint16 *) client); + bytes += create_packet_w(buf, &cursor, *(guint16 *) cmd); + bytes += create_packet_w(buf, &cursor, *(guint16 *) seq); + bytes += create_packet_dw(buf, &cursor, uid); + if (body) { + bytes += create_packet_data(buf, &cursor, body, len); + g_free(body); + } + bytes += create_packet_b(buf, &cursor, QQ_PACKET_TAIL); - g_free(buffer); + gaim_debug(GAIM_DEBUG_INFO, "QQ", "Custom packet of length %i\n", bytes); + _qq_show_packet("Outgoing custom packet", buf, bytes); + + _qq_send_packet(gc, buf, bytes, *(guint16 *) cmd); + g_free(client); + g_free(cmd); + g_free(seq); } -*/ /* send a custom packet to the server - for protocol testing */ -/* static void _qq_menu_send_custom_packet(GaimPluginAction *action) { - GaimConnection *gc = (GaimConnection *) action->context; - g_return_if_fail(gc != NULL); - gaim_request_input(gc, _("Send Custom Packet"), - _("Enter the packet in hex here"), - _("Include the command and everything following"), - NULL, FALSE, FALSE, NULL, - _("Send"), G_CALLBACK(_qq_send_custom_packet), _("Cancel"), NULL, gc); + GaimConnection *gc; + GaimRequestFields *fields; + GaimRequestFieldGroup *group; + GaimRequestField *field; + gchar *tmp; + qq_data *qd; + + gc = (GaimConnection *) action->context; + qd = (qq_data *) gc->proto_data; + g_return_if_fail(gc != NULL && qd != NULL); + + fields = gaim_request_fields_new(); + group = gaim_request_field_group_new(_("Packet Elements")); + gaim_request_fields_add_group(fields, group); + tmp = g_strdup_printf("%04X", QQ_CLIENT); + field = gaim_request_field_string_new("client", _("Client (hex)"), tmp, FALSE); + g_free(tmp); + gaim_request_field_group_add_field(group, field); + field = gaim_request_field_string_new("cmd", _("Command (hex)"), "0000", FALSE); + gaim_request_field_group_add_field(group, field); + field = gaim_request_field_string_new("seq", _("Sequence (hex)"), "0000", FALSE); + gaim_request_field_group_add_field(group, field); + tmp = g_strdup_printf("%u", qd->uid); + field = gaim_request_field_string_new("uid", _("QQ Number (decimal)"), tmp, FALSE); + g_free(tmp); + gaim_request_field_group_add_field(group, field); + field = gaim_request_field_string_new("body", _("Body (hex)"), NULL, FALSE); + gaim_request_field_group_add_field(group, field); + + gaim_request_fields(gc, _("Send a custom packet"), + _("Send a custom packet"), NULL, fields, + _("Send"), G_CALLBACK(_qq_send_custom_packet_cb), + _("Cancel"), NULL, + gc); } -*/ /* protocol related menus */ static GList *_qq_actions(GaimPlugin *plugin, gpointer context) @@ -727,7 +829,7 @@ act = gaim_plugin_action_new(_("Show Login Information"), _qq_menu_show_login_info); m = g_list_append(m, act); - /* + /* act = gaim_plugin_action_new(_("Send Custom Packet"), _qq_menu_send_custom_packet); m = g_list_append(m, act); */ @@ -737,7 +839,7 @@ m = g_list_append(m, act); */ - /* XXX the old group gtk code needs to moved to the gaim UI before this can be used + /* act = gaim_plugin_action_new(_("Qun: Search a permanent Qun"), _qq_menu_search_or_add_permanent_group); m = g_list_append(m, act); Modified: trunk/src/protocols/qq/recv_core.c =================================================================== --- trunk/src/protocols/qq/recv_core.c 2006-08-07 03:24:39 UTC (rev 16661) +++ trunk/src/protocols/qq/recv_core.c 2006-08-07 06:17:13 UTC (rev 16662) @@ -90,6 +90,7 @@ data = g_newa(guint8, len); msg_utf8 = NULL; + _qq_show_packet("Processing unknown packet", buf, len); if (qq_crypt(DECRYPT, buf, buf_len, qd->session_key, data, &len)) { gaim_debug(GAIM_DEBUG_WARNING, "QQ", ">>> [%d] %s, %d bytes -> [default] decrypt and dump\n%s", Modified: trunk/src/protocols/qq/send_core.h =================================================================== --- trunk/src/protocols/qq/send_core.h 2006-08-07 03:24:39 UTC (rev 16661) +++ trunk/src/protocols/qq/send_core.h 2006-08-07 06:17:13 UTC (rev 16662) @@ -28,9 +28,10 @@ #define QQ_CLIENT 0x0E1B +/* #define QQ_CLIENT 0x0F3F */ -gint -qq_send_cmd(GaimConnection *gc, - guint16 cmd, gboolean is_auto_seq, guint16 seq, gboolean need_ack, guint8 *data, gint len); +gint qq_send_cmd(GaimConnection *gc, guint16 cmd, gboolean is_auto_seq, guint16 seq, + gboolean need_ack, guint8 *data, gint len); +gint _qq_send_packet(GaimConnection * gc, guint8 *buf, gint len, guint16 cmd); #endif Modified: trunk/src/protocols/qq/utils.c =================================================================== --- trunk/src/protocols/qq/utils.c 2006-08-07 03:24:39 UTC (rev 16661) +++ trunk/src/protocols/qq/utils.c 2006-08-07 06:17:13 UTC (rev 16662) @@ -199,6 +199,8 @@ gchar *ret; int i; + g_return_val_if_fail(buffer != NULL, NULL); + stripped = g_string_new(""); for (i=0; i<strlen(buffer); i++) { if ((int) buffer[i] != 32) { @@ -214,12 +216,14 @@ /* Dumps an ASCII hex string to a string of bytes. The return should be freed later. * Returns NULL if a string with an odd number of nibbles is passed in or if buffer * isn't a valid hex string */ -guint8 *hex_str_to_bytes(const gchar *buffer) +guint8 *hex_str_to_bytes(const gchar *buffer, gint *out_len) { gchar *hex_str, *hex_buffer, *cursor, tmp; guint8 *bytes, nibble1, nibble2; - gint index, len; + gint index; + g_return_val_if_fail(buffer != NULL, NULL); + hex_buffer = strstrip(buffer); if (strlen(hex_buffer) % 2 != 0) { @@ -233,10 +237,11 @@ g_free(hex_buffer); index = 0; for (cursor = hex_str; cursor < hex_str + sizeof(gchar) * (strlen(hex_str)) - 1; cursor++) { - if (g_ascii_isdigit(*cursor)) {tmp = *cursor; nibble1 = atoi(&tmp); } - else if (g_ascii_isalpha(*cursor) && (gint) *cursor - 87 < 16) + if (g_ascii_isdigit(*cursor)) { + tmp = *cursor; nibble1 = atoi(&tmp); + } else if (g_ascii_isalpha(*cursor) && (gint) *cursor - 87 < 16) { nibble1 = (gint) *cursor - 87; - else { + } else { gaim_debug(GAIM_DEBUG_WARNING, "QQ", "Invalid char found in hex string!\n"); g_free(hex_str); @@ -244,18 +249,21 @@ } nibble1 = nibble1 << 4; cursor++; - if (g_ascii_isdigit(*cursor)) {tmp = *cursor; nibble2 = atoi(&tmp); } - else if (g_ascii_isalpha(*cursor) && (gint) (*cursor - 87) < 16) + if (g_ascii_isdigit(*cursor)) { + tmp = *cursor; nibble2 = atoi(&tmp); + } else if (g_ascii_isalpha(*cursor) && (gint) (*cursor - 87) < 16) { nibble2 = (gint) *cursor - 87; - else { + } else { + gaim_debug(GAIM_DEBUG_WARNING, "QQ", + "Invalid char found in hex string!\n"); g_free(hex_str); return NULL; } bytes[index++] = nibble1 + nibble2; } - len = strlen(hex_str) / 2; + *out_len = strlen(hex_str) / 2; g_free(hex_str); - return g_memdup(bytes, len); + return g_memdup(bytes, *out_len); } /* Dumps a chunk of raw data into an ASCII hex string. The return should be freed later. */ Modified: trunk/src/protocols/qq/utils.h =================================================================== --- trunk/src/protocols/qq/utils.h 2006-08-07 03:24:39 UTC (rev 16661) +++ trunk/src/protocols/qq/utils.h 2006-08-07 06:17:13 UTC (rev 16662) @@ -43,7 +43,7 @@ void try_dump_as_gbk(guint8 *data, gint len); -guint8 *hex_str_to_bytes(const gchar *buf); +guint8 *hex_str_to_bytes(const gchar *buf, gint *out_len); gchar *hex_dump_to_str(const guint8 *buf, gint buf_len); #endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2006-08-07 03:24:44
|
Revision: 16661 Author: sadrul Date: 2006-08-06 20:24:39 -0700 (Sun, 06 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16661&view=rev Log Message: ----------- Allow multi-select to work for requests. Modified Paths: -------------- trunk/console/gntrequest.c Modified: trunk/console/gntrequest.c =================================================================== --- trunk/console/gntrequest.c 2006-08-07 02:15:58 UTC (rev 16660) +++ trunk/console/gntrequest.c 2006-08-07 03:24:39 UTC (rev 16661) @@ -252,8 +252,27 @@ else if (type == GAIM_REQUEST_FIELD_LIST) { GntWidget *tree = field->ui_data; - gpointer data = gnt_tree_get_selection_data(GNT_TREE(tree)); - GList *list = g_list_append(NULL, data); /* XXX: Update when multi-select is allowed */ + GList *list = NULL; + + if (gaim_request_field_list_get_multi_select(field)) + { + const GList *iter; + + iter = gaim_request_field_list_get_items(field); + for (; iter; iter = iter->next) + { + const char *text = list->data; + gpointer key = gaim_request_field_list_get_data(field, text); + if (gnt_tree_get_choice(GNT_TREE(tree), key)) + list = g_list_prepend(list, key); + } + } + else + { + gpointer data = gnt_tree_get_selection_data(GNT_TREE(tree)); + list = g_list_append(list, data); + } + gaim_request_field_list_set_selected(field, list); g_list_free(list); } @@ -355,8 +374,8 @@ } else if (type == GAIM_REQUEST_FIELD_LIST) { - /* XXX: Yet to allow multi-select, because the feature is absent in GntTree */ const GList *list; + gboolean multi = gaim_request_field_list_get_multi_select(field); GntWidget *tree = gnt_tree_new(); gnt_box_add_widget(GNT_BOX(hbox), tree); field->ui_data = tree; @@ -366,10 +385,20 @@ { const char *text = list->data; gpointer key = gaim_request_field_list_get_data(field, text); - gnt_tree_add_row_after(GNT_TREE(tree), key, - gnt_tree_create_row(GNT_TREE(tree), text), NULL, NULL); - if (gaim_request_field_list_is_selected(field, text)) - gnt_tree_set_selected(GNT_TREE(tree), key); + if (multi) + { + gnt_tree_add_choice(GNT_TREE(tree), key, + gnt_tree_create_row(GNT_TREE(tree), text), NULL, NULL); + if (gaim_request_field_list_is_selected(field, text)) + gnt_tree_set_choice(GNT_TREE(tree), key, TRUE); + } + else + { + gnt_tree_add_row_after(GNT_TREE(tree), key, + gnt_tree_create_row(GNT_TREE(tree), text), NULL, NULL); + if (gaim_request_field_list_is_selected(field, text)) + gnt_tree_set_selected(GNT_TREE(tree), key); + } } } #if 0 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2006-08-07 02:16:07
|
Revision: 16660 Author: sadrul Date: 2006-08-06 19:15:58 -0700 (Sun, 06 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16660&view=rev Log Message: ----------- A couple of minor adjustments, memory leak fixes. And request-ui is almost complete now. Modified Paths: -------------- trunk/console/gntblist.c trunk/console/gntconv.c trunk/console/gntrequest.c trunk/console/libgnt/gntcombobox.c trunk/console/libgnt/gnttree.h trunk/console/libgnt/test/combo.c Modified: trunk/console/gntblist.c =================================================================== --- trunk/console/gntblist.c 2006-08-06 23:56:42 UTC (rev 16659) +++ trunk/console/gntblist.c 2006-08-07 02:15:58 UTC (rev 16660) @@ -61,7 +61,7 @@ static void add_chat(GaimChat *chat, GGBlist *ggblist); static void add_node(GaimBlistNode *node, GGBlist *ggblist); static void draw_tooltip(GGBlist *ggblist); -static void remove_typing_cb(gpointer null); +static gboolean remove_typing_cb(gpointer null); static void remove_peripherals(GGBlist *ggblist); static const char * get_display_name(GaimBlistNode *node); @@ -873,7 +873,7 @@ return; } -static void +static gboolean remove_typing_cb(gpointer null) { GaimSavedStatus *current; @@ -887,7 +887,7 @@ newmessage = gnt_entry_get_text(GNT_ENTRY(ggblist->statustext)); item = gnt_combo_box_get_selected_data(GNT_COMBO_BOX(ggblist->status)); - g_return_if_fail(item->type == STATUS_PRIMITIVE); + g_return_val_if_fail(item->type == STATUS_PRIMITIVE, FALSE); newprim = item->u.prim; if (newprim != prim || ((message && !newmessage) || @@ -908,6 +908,7 @@ gnt_box_give_focus_to_child(GNT_BOX(ggblist->window), ggblist->tree); g_source_remove(ggblist->typing); ggblist->typing = 0; + return FALSE; } static void @@ -932,7 +933,7 @@ static gboolean status_text_changed(GntEntry *entry, const char *text, gpointer null) { - if (text[0] == 27 && ggblist->typing == 0) + if ((text[0] == 27 || (text[0] == '\t' && text[1] == '\0')) && ggblist->typing == 0) return FALSE; g_source_remove(ggblist->typing); Modified: trunk/console/gntconv.c =================================================================== --- trunk/console/gntconv.c 2006-08-06 23:56:42 UTC (rev 16659) +++ trunk/console/gntconv.c 2006-08-07 02:15:58 UTC (rev 16660) @@ -107,17 +107,20 @@ } else { + char *escape = g_markup_escape_text(text, -1); switch (gaim_conversation_get_type(ggconv->conv)) { case GAIM_CONV_TYPE_IM: - gaim_conv_im_send_with_flags(GAIM_CONV_IM(ggconv->conv), text, GAIM_MESSAGE_SEND); + gaim_conv_im_send_with_flags(GAIM_CONV_IM(ggconv->conv), escape, GAIM_MESSAGE_SEND); break; case GAIM_CONV_TYPE_CHAT: - gaim_conv_chat_send(GAIM_CONV_CHAT(ggconv->conv), text); + gaim_conv_chat_send(GAIM_CONV_CHAT(ggconv->conv), escape); break; default: + g_free(escape); g_return_val_if_reached(FALSE); } + g_free(escape); } gnt_entry_clear(GNT_ENTRY(ggconv->entry)); return TRUE; Modified: trunk/console/gntrequest.c =================================================================== --- trunk/console/gntrequest.c 2006-08-06 23:56:42 UTC (rev 16659) +++ trunk/console/gntrequest.c 2006-08-07 02:15:58 UTC (rev 16660) @@ -1,15 +1,19 @@ #include <gnt.h> #include <gntbox.h> #include <gntbutton.h> +#include <gntcheckbox.h> #include <gntcombobox.h> #include <gntentry.h> #include <gntlabel.h> +#include <gntline.h> +#include <gnttree.h> +#include "gntgaim.h" #include "gntrequest.h" static GntWidget * setup_request_window(const char *title, const char *primary, - const char *secondary) + const char *secondary, GaimRequestType type) { GntWidget *window; @@ -24,6 +28,9 @@ if (secondary) gnt_box_add_widget(GNT_BOX(window), gnt_label_new(secondary)); + g_signal_connect_swapped(G_OBJECT(window), "destroy", G_CALLBACK(gaim_request_close), + GINT_TO_POINTER(type)); + return window; } @@ -35,7 +42,7 @@ const char *text; gpointer callback; - box = gnt_hbox_new(TRUE); + box = gnt_hbox_new(FALSE); va_start(list, data); @@ -79,7 +86,7 @@ { GntWidget *window, *box, *entry; - window = setup_request_window(title, primary, secondary); + window = setup_request_window(title, primary, secondary, GAIM_REQUEST_INPUT); entry = gnt_entry_new(default_value); if (masked) @@ -131,7 +138,7 @@ const char *text; int val; - window = setup_request_window(title, primary, secondary); + window = setup_request_window(title, primary, secondary, GAIM_REQUEST_CHOICE); combo = gnt_combo_box_new(); gnt_box_add_widget(GNT_BOX(window), combo); @@ -173,7 +180,7 @@ GntWidget *window, *box, *button; int i; - window = setup_request_window(title, primary, secondary); + window = setup_request_window(title, primary, secondary, GAIM_REQUEST_ACTION); box = gnt_hbox_new(TRUE); gnt_box_add_widget(GNT_BOX(window), box); @@ -196,12 +203,212 @@ return window; } +static void +request_fields_cb(GntWidget *button, GaimRequestFields *fields) +{ + GaimRequestFieldsCb callback = g_object_get_data(G_OBJECT(button), "activate-callback"); + gpointer data = g_object_get_data(G_OBJECT(button), "activate-userdata"); + GList *list; + + /* Update the data of the fields. GtkGaim does this differently. Instead of + * updating the fields at the end like here, it updates the appropriate field + * instantly whenever a change is made. That allows it to make sure the + * 'required' fields are entered before the user can hit OK. It's not the case + * here, althought it can be done. I am not honouring the 'required' fields + * for the moment. */ + for (list = gaim_request_fields_get_groups(fields); list; list = list->next) + { + GaimRequestFieldGroup *group = list->data; + GList *fields = gaim_request_field_group_get_fields(group); + + for (; fields ; fields = fields->next) + { + GaimRequestField *field = fields->data; + GaimRequestFieldType type = gaim_request_field_get_type(field); + if (type == GAIM_REQUEST_FIELD_BOOLEAN) + { + GntWidget *check = field->ui_data; + gboolean value = gnt_check_box_get_checked(GNT_CHECK_BOX(check)); + gaim_request_field_bool_set_value(field, value); + } + else if (type == GAIM_REQUEST_FIELD_STRING) + { + GntWidget *entry = field->ui_data; + gaim_request_field_string_set_value(field, gnt_entry_get_text(GNT_ENTRY(entry))); + } + else if (type == GAIM_REQUEST_FIELD_INTEGER) + { + GntWidget *entry = field->ui_data; + const char *text = gnt_entry_get_text(GNT_ENTRY(entry)); + int value = (text && *text) ? atoi(text) : 0; + gaim_request_field_int_set_value(field, value); + } + else if (type == GAIM_REQUEST_FIELD_CHOICE) + { + GntWidget *combo = field->ui_data;; + int id = GPOINTER_TO_INT(gnt_combo_box_get_selected_data(GNT_COMBO_BOX(combo))); + gaim_request_field_choice_set_value(field, id); + } + else if (type == GAIM_REQUEST_FIELD_LIST) + { + GntWidget *tree = field->ui_data; + gpointer data = gnt_tree_get_selection_data(GNT_TREE(tree)); + GList *list = g_list_append(NULL, data); /* XXX: Update when multi-select is allowed */ + gaim_request_field_list_set_selected(field, list); + g_list_free(list); + } + else if (type == GAIM_REQUEST_FIELD_ACCOUNT) + { + } + } + } + + if (callback) + callback(data, fields); + + while (button->parent) + button = button->parent; + + gaim_request_close(GAIM_REQUEST_FIELDS, button); +} + +static void * +gg_request_fields(const char *title, const char *primary, + const char *secondary, GaimRequestFields *fields, + const char *ok, GCallback ok_cb, + const char *cancel, GCallback cancel_cb, + void *userdata) +{ + GntWidget *window, *box; + GList *list; + + window = setup_request_window(title, primary, secondary, GAIM_REQUEST_FIELDS); + + /* This is how it's going to work: the request-groups are going to be + * stacked vertically one after the other. A GntLine will be separating + * the groups. */ + box = gnt_vbox_new(FALSE); + gnt_box_set_pad(GNT_BOX(box), 0); + gnt_box_set_fill(GNT_BOX(box), TRUE); + for (list = gaim_request_fields_get_groups(fields); list; list = list->next) + { + GaimRequestFieldGroup *group = list->data; + GList *fields = gaim_request_field_group_get_fields(group); + GntWidget *hbox; + + /* XXX: Do something with the title, perhaps add a bold label */ + + for (; fields ; fields = fields->next) + { + GaimRequestField *field = fields->data; + GaimRequestFieldType type = gaim_request_field_get_type(field); + const char *label = gaim_request_field_get_label(field); + + hbox = gnt_hbox_new(FALSE); + gnt_box_set_pad(GNT_BOX(hbox), 0); + gnt_box_add_widget(GNT_BOX(box), hbox); + + if (type != GAIM_REQUEST_FIELD_BOOLEAN) + gnt_box_add_widget(GNT_BOX(hbox), gnt_label_new(label)); + + if (type == GAIM_REQUEST_FIELD_BOOLEAN) + { + GntWidget *check = gnt_check_box_new(label); + gnt_check_box_set_checked(GNT_CHECK_BOX(check), + gaim_request_field_bool_get_default_value(field)); + gnt_box_add_widget(GNT_BOX(hbox), check); + field->ui_data = check; + } + else if (type == GAIM_REQUEST_FIELD_STRING) + { + GntWidget *entry = gnt_entry_new( + gaim_request_field_string_get_default_value(field)); + gnt_entry_set_masked(GNT_ENTRY(entry), + gaim_request_field_string_is_masked(field)); + gnt_box_add_widget(GNT_BOX(hbox), entry); + field->ui_data = entry; + } + else if (type == GAIM_REQUEST_FIELD_INTEGER) + { + GntWidget *entry = gnt_entry_new( + gaim_request_field_string_get_default_value(field)); + gnt_entry_set_flag(GNT_ENTRY(entry), GNT_ENTRY_FLAG_INT); + gnt_box_add_widget(GNT_BOX(hbox), entry); + field->ui_data = entry; + } + else if (type == GAIM_REQUEST_FIELD_CHOICE) + { + int id; + const GList *list; + GntWidget *combo = gnt_combo_box_new(); + gnt_box_add_widget(GNT_BOX(hbox), combo); + field->ui_data = combo; + + list = gaim_request_field_choice_get_labels(field); + for (id = 1; list; list = list->next, id++) + { + gnt_combo_box_add_data(GNT_COMBO_BOX(combo), + GINT_TO_POINTER(id), list->data); + } + gnt_combo_box_set_selected(GNT_COMBO_BOX(combo), + GINT_TO_POINTER(gaim_request_field_choice_get_default_value(field))); + } + else if (type == GAIM_REQUEST_FIELD_LIST) + { + /* XXX: Yet to allow multi-select, because the feature is absent in GntTree */ + const GList *list; + GntWidget *tree = gnt_tree_new(); + gnt_box_add_widget(GNT_BOX(hbox), tree); + field->ui_data = tree; + + list = gaim_request_field_list_get_items(field); + for (; list; list = list->next) + { + const char *text = list->data; + gpointer key = gaim_request_field_list_get_data(field, text); + gnt_tree_add_row_after(GNT_TREE(tree), key, + gnt_tree_create_row(GNT_TREE(tree), text), NULL, NULL); + if (gaim_request_field_list_is_selected(field, text)) + gnt_tree_set_selected(GNT_TREE(tree), key); + } + } +#if 0 + else if (type == GAIM_REQUEST_FIELD_ACCOUNT) + { + /* XXX: remember to set the field->ui_data */ + } +#endif + else + { + gnt_box_add_widget(GNT_BOX(hbox), + gnt_label_new_with_format(_("Not implemented yet."), + GNT_TEXT_FLAG_BOLD)); + } + if (fields->next) + gnt_box_add_widget(GNT_BOX(box), gnt_hline_new()); + } + } + gnt_box_add_widget(GNT_BOX(window), box); + + box = setup_button_box(userdata, request_fields_cb, fields, + ok, ok_cb, cancel, cancel_cb, NULL); + gnt_box_add_widget(GNT_BOX(window), box); + + gnt_widget_show(window); + + + return window; +} + static GaimRequestUiOps uiops = { .request_input = gg_request_input, .close_request = gg_close_request, .request_choice = gg_request_choice, .request_action = gg_request_action, + .request_fields = gg_request_fields, + .request_file = NULL, /* No plans for these */ + .request_folder = NULL }; GaimRequestUiOps *gg_request_get_ui_ops() Modified: trunk/console/libgnt/gntcombobox.c =================================================================== --- trunk/console/libgnt/gntcombobox.c 2006-08-06 23:56:42 UTC (rev 16659) +++ trunk/console/libgnt/gntcombobox.c 2006-08-07 02:15:58 UTC (rev 16660) @@ -41,15 +41,13 @@ if (box->dropdown) { - text = (char *)gnt_tree_get_selection_text(GNT_TREE(box->dropdown)); + text = gnt_tree_get_selection_text(GNT_TREE(box->dropdown)); box->selected = gnt_tree_get_selection_data(GNT_TREE(box->dropdown)); } if (text == NULL) - text = ""; + text = g_strdup(text); - text = g_strdup(text); - if (gnt_widget_has_focus(widget)) type = GNT_COLOR_HIGHLIGHT; else @@ -102,6 +100,7 @@ case '\t': set_selection(box, gnt_tree_get_selection_data(GNT_TREE(box->dropdown))); case 27: + gnt_tree_set_selected(GNT_TREE(box->dropdown), box->selected); gnt_widget_hide(box->dropdown->parent); return TRUE; break; @@ -118,18 +117,18 @@ strcmp(text + 1, GNT_KEY_DOWN) == 0) { GntWidget *parent = box->dropdown->parent; - gnt_widget_set_size(box->dropdown, widget->priv.width, 9); - gnt_widget_set_position(parent, - widget->priv.x, widget->priv.y + widget->priv.height - 1); + int height = g_list_length(GNT_TREE(box->dropdown)->list); + int y = widget->priv.y + widget->priv.height - 1; + gnt_widget_set_size(box->dropdown, widget->priv.width, height + 2); + + if (y + height + 2 >= getmaxy(stdscr)) + y = widget->priv.y - height - 1; + gnt_widget_set_position(parent, widget->priv.x, y); if (parent->window) { - if (mvwin(parent->window, widget->priv.y + widget->priv.height - 1, - widget->priv.x) == ERR) - mvwin(parent->window, - widget->priv.y - 9 + 1, widget->priv.x); + mvwin(parent->window, y, widget->priv.x); } - GNT_WIDGET_SET_FLAGS(parent, GNT_WIDGET_TRANSIENT); gnt_widget_draw(parent); return TRUE; } @@ -192,7 +191,7 @@ combo->dropdown = gnt_tree_new(); box = gnt_box_new(FALSE, FALSE); - GNT_WIDGET_SET_FLAGS(box, GNT_WIDGET_NO_SHADOW | GNT_WIDGET_NO_BORDER); + GNT_WIDGET_SET_FLAGS(box, GNT_WIDGET_NO_SHADOW | GNT_WIDGET_NO_BORDER | GNT_WIDGET_TRANSIENT); gnt_box_set_pad(GNT_BOX(box), 0); gnt_box_add_widget(GNT_BOX(box), combo->dropdown); Modified: trunk/console/libgnt/gnttree.h =================================================================== --- trunk/console/libgnt/gnttree.h 2006-08-06 23:56:42 UTC (rev 16659) +++ trunk/console/libgnt/gnttree.h 2006-08-07 02:15:58 UTC (rev 16660) @@ -78,6 +78,7 @@ gpointer gnt_tree_get_selection_data(GntTree *tree); +/* Returned string needs to be freed */ char *gnt_tree_get_selection_text(GntTree *tree); GList *gnt_tree_get_selection_text_list(GntTree *tree); Modified: trunk/console/libgnt/test/combo.c =================================================================== --- trunk/console/libgnt/test/combo.c 2006-08-06 23:56:42 UTC (rev 16659) +++ trunk/console/libgnt/test/combo.c 2006-08-07 02:15:58 UTC (rev 16660) @@ -46,6 +46,9 @@ gnt_combo_box_add_data(GNT_COMBO_BOX(combo), "4", "4"); gnt_combo_box_add_data(GNT_COMBO_BOX(combo), "5", "5"); gnt_combo_box_add_data(GNT_COMBO_BOX(combo), "6", "6"); + gnt_combo_box_add_data(GNT_COMBO_BOX(combo), "7", "7"); + gnt_combo_box_add_data(GNT_COMBO_BOX(combo), "8", "8"); + gnt_combo_box_add_data(GNT_COMBO_BOX(combo), "9", "9"); gnt_box_add_widget(GNT_BOX(hbox), gnt_label_new("Select")); gnt_box_add_widget(GNT_BOX(hbox), combo); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dat...@us...> - 2006-08-06 23:56:49
|
Revision: 16659 Author: datallah Date: 2006-08-06 16:56:42 -0700 (Sun, 06 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16659&view=rev Log Message: ----------- Backport of 16658 (Fix for non-ascii yahoo passwords). Modified Paths: -------------- branches/v2_0_0/src/protocols/yahoo/yahoo.c Modified: branches/v2_0_0/src/protocols/yahoo/yahoo.c =================================================================== --- branches/v2_0_0/src/protocols/yahoo/yahoo.c 2006-08-06 23:47:34 UTC (rev 16658) +++ branches/v2_0_0/src/protocols/yahoo/yahoo.c 2006-08-06 23:56:42 UTC (rev 16659) @@ -1241,6 +1241,7 @@ GaimAccount *account = gaim_connection_get_account(gc); const char *name = gaim_normalize(account, gaim_account_get_username(account)); const char *pass = gaim_connection_get_password(gc); + char *enc_pass; struct yahoo_data *yd = gc->proto_data; GaimCipher *md5_cipher; @@ -1472,14 +1473,20 @@ magic_key_char[3] = (updated_key >> 24) & 0xff; } + enc_pass = yahoo_string_encode(gc, pass, NULL); + /* Get password and crypt hashes as per usual. */ gaim_cipher_context_reset(md5_ctx, NULL); - gaim_cipher_context_append(md5_ctx, (const guchar *)pass, strlen(pass)); + gaim_cipher_context_append(md5_ctx, (const guchar *)enc_pass, strlen(enc_pass)); gaim_cipher_context_digest(md5_ctx, sizeof(md5_digest), md5_digest, NULL); to_y64(password_hash, md5_digest, 16); - crypt_result = yahoo_crypt(pass, "$1$_2S43d5f$"); + crypt_result = yahoo_crypt(enc_pass, "$1$_2S43d5f$"); + + g_free(enc_pass); + enc_pass = NULL; + gaim_cipher_context_reset(md5_ctx, NULL); gaim_cipher_context_append(md5_ctx, (const guchar *)crypt_result, strlen(crypt_result)); gaim_cipher_context_digest(md5_ctx, sizeof(md5_digest), This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dat...@us...> - 2006-08-06 23:47:45
|
Revision: 16658 Author: datallah Date: 2006-08-06 16:47:34 -0700 (Sun, 06 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16658&view=rev Log Message: ----------- It has been too long since I did something productive here. Fix logging into yahoo with a password containing non-ascii characters. This fixes bug #1534796. Modified Paths: -------------- trunk/src/protocols/yahoo/yahoo.c Modified: trunk/src/protocols/yahoo/yahoo.c =================================================================== --- trunk/src/protocols/yahoo/yahoo.c 2006-08-06 21:03:10 UTC (rev 16657) +++ trunk/src/protocols/yahoo/yahoo.c 2006-08-06 23:47:34 UTC (rev 16658) @@ -1241,6 +1241,7 @@ GaimAccount *account = gaim_connection_get_account(gc); const char *name = gaim_normalize(account, gaim_account_get_username(account)); const char *pass = gaim_connection_get_password(gc); + char *enc_pass; struct yahoo_data *yd = gc->proto_data; GaimCipher *md5_cipher; @@ -1472,14 +1473,20 @@ magic_key_char[3] = (updated_key >> 24) & 0xff; } + enc_pass = yahoo_string_encode(gc, pass, NULL); + /* Get password and crypt hashes as per usual. */ gaim_cipher_context_reset(md5_ctx, NULL); - gaim_cipher_context_append(md5_ctx, (const guchar *)pass, strlen(pass)); + gaim_cipher_context_append(md5_ctx, (const guchar *)enc_pass, strlen(enc_pass)); gaim_cipher_context_digest(md5_ctx, sizeof(md5_digest), md5_digest, NULL); to_y64(password_hash, md5_digest, 16); - crypt_result = yahoo_crypt(pass, "$1$_2S43d5f$"); + crypt_result = yahoo_crypt(enc_pass, "$1$_2S43d5f$"); + + g_free(enc_pass); + enc_pass = NULL; + gaim_cipher_context_reset(md5_ctx, NULL); gaim_cipher_context_append(md5_ctx, (const guchar *)crypt_result, strlen(crypt_result)); gaim_cipher_context_digest(md5_ctx, sizeof(md5_digest), This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2006-08-06 21:03:20
|
Revision: 16657 Author: markhuetsch Date: 2006-08-06 14:03:10 -0700 (Sun, 06 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16657&view=rev Log Message: ----------- Took care of some signedness issues. Modified Paths: -------------- trunk/src/protocols/qq/char_conv.c trunk/src/protocols/qq/file_trans.c trunk/src/protocols/qq/im.c trunk/src/protocols/qq/im.h trunk/src/protocols/qq/qq_proxy.c trunk/src/protocols/qq/qq_proxy.h trunk/src/protocols/qq/send_file.c trunk/src/protocols/qq/udp_proxy_s5.c Modified: trunk/src/protocols/qq/char_conv.c =================================================================== --- trunk/src/protocols/qq/char_conv.c 2006-08-06 18:19:36 UTC (rev 16656) +++ trunk/src/protocols/qq/char_conv.c 2006-08-06 21:03:10 UTC (rev 16657) @@ -38,7 +38,7 @@ #define QQ_NULL_SMILEY "(SM)" /* return this if smiley conversion fails */ /* a debug function */ -void _qq_show_packet(gchar * desc, gchar * buf, gint len); +void _qq_show_packet(const gchar *desc, const guint8 *buf, gint len); const gchar qq_smiley_map[QQ_SMILEY_AMOUNT] = { 0x41, 0x43, 0x42, 0x44, 0x45, 0x46, 0x47, 0x48, Modified: trunk/src/protocols/qq/file_trans.c =================================================================== --- trunk/src/protocols/qq/file_trans.c 2006-08-06 18:19:36 UTC (rev 16656) +++ trunk/src/protocols/qq/file_trans.c 2006-08-06 21:03:10 UTC (rev 16657) @@ -282,7 +282,7 @@ return bytes; } -extern gchar *_gen_session_md5(gint uid, gchar *session_key); +extern gchar *_gen_session_md5(gint uid, guint8 *session_key); /* send a file to udp channel with QQ_FILE_CONTROL_PACKET_TAG */ void qq_send_file_ctl_packet(GaimConnection *gc, guint16 packet_type, guint32 to_uid, guint8 hellobyte) Modified: trunk/src/protocols/qq/im.c =================================================================== --- trunk/src/protocols/qq/im.c 2006-08-06 18:19:36 UTC (rev 16656) +++ trunk/src/protocols/qq/im.c 2006-08-06 21:03:10 UTC (rev 16657) @@ -45,7 +45,7 @@ #define DEFAULT_FONT_NAME_LEN 4 /* a debug function */ -void _qq_show_packet(gchar *desc, gchar *buf, gint len); +void _qq_show_packet(const gchar *desc, const guint8 *buf, gint len); enum { @@ -94,7 +94,7 @@ guint8 is_there_font_attr; guint8 unknown3[4]; guint8 msg_type; - guint8 *msg; /* no fixed length, ends with 0x00 */ + gchar *msg; /* no fixed length, ends with 0x00 */ guint8 *font_attr; gint font_attr_len; }; @@ -121,11 +121,11 @@ guint8 *qq_get_send_im_tail(const gchar *font_color, const gchar *font_size, const gchar *font_name, - gboolean is_bold, gboolean is_italic, gboolean is_underline, guint tail_len) + gboolean is_bold, gboolean is_italic, gboolean is_underline, gint tail_len) { gchar *s1, *s2; unsigned char *rgb; - guint font_name_len; + gint font_name_len; guint8 *send_im_tail; const guint8 simsun[] = { 0xcb, 0xce, 0xcc, 0xe5 }; @@ -133,14 +133,14 @@ font_name_len = strlen(font_name); } else { font_name_len = DEFAULT_FONT_NAME_LEN; - font_name = simsun; + font_name = (const gchar *) simsun; } send_im_tail = g_new0(guint8, tail_len); - g_strlcpy(send_im_tail + QQ_SEND_IM_AFTER_MSG_HEADER_LEN, + g_strlcpy((gchar *) (send_im_tail + QQ_SEND_IM_AFTER_MSG_HEADER_LEN), font_name, tail_len - QQ_SEND_IM_AFTER_MSG_HEADER_LEN); - send_im_tail[tail_len - 1] = tail_len; + send_im_tail[tail_len - 1] = (guint8) tail_len; send_im_tail[0] = 0x00; if (font_size) { @@ -210,14 +210,13 @@ } /* generate a md5 key using uid and session_key */ -gchar *_gen_session_md5(gint uid, gchar *session_key) +gchar *_gen_session_md5(gint uid, guint8 *session_key) { - gchar *src, md5_str[QQ_KEY_LENGTH]; - guint8 *cursor; + guint8 *src, md5_str[QQ_KEY_LENGTH], *cursor; GaimCipher *cipher; GaimCipherContext *context; - src = g_newa(gchar, 20); + src = g_newa(guint8, 20); cursor = src; create_packet_dw(src, &cursor, uid); create_packet_data(src, &cursor, session_key, QQ_KEY_LENGTH); @@ -309,15 +308,15 @@ * even the is_there_font_attr shows 0x01, and msg does not ends with 0x00 */ if (im_text->msg_type == QQ_IM_AUTO_REPLY) { im_text->is_there_font_attr = 0x00; /* indeed there is no this flag */ - im_text->msg = g_strndup(*cursor, data + len - *cursor); + im_text->msg = g_strndup(*(gchar **) cursor, data + len - *cursor); } else { /* it is normal mesasge */ if (im_text->is_there_font_attr) { - im_text->msg = g_strdup(*cursor); + im_text->msg = g_strdup(*(gchar **) cursor); *cursor += strlen(im_text->msg) + 1; im_text->font_attr_len = data + len - *cursor; im_text->font_attr = g_memdup(*cursor, im_text->font_attr_len); } else /* not im_text->is_there_font_attr */ - im_text->msg = g_strndup(*cursor, data + len - *cursor); + im_text->msg = g_strndup(*(gchar **) cursor, data + len - *cursor); } /* if im_text->msg_type */ _qq_show_packet("QQ_MESG recv", data, *cursor - data); @@ -450,9 +449,9 @@ void qq_send_packet_im(GaimConnection *gc, guint32 to_uid, gchar *msg, gint type) { qq_data *qd; - guint8 *cursor, *raw_data; + guint8 *cursor, *raw_data, *send_im_tail; guint16 client_tag, normal_im_type; - gint msg_len, raw_len, bytes; + gint msg_len, raw_len, font_name_len, tail_len, bytes; time_t now; gchar *md5, *msg_filtered; GData *attribs; @@ -512,7 +511,6 @@ now = time(NULL); md5 = _gen_session_md5(qd->uid, qd->session_key); - guint font_name_len, tail_len; font_name_len = (font_name) ? strlen(font_name) : DEFAULT_FONT_NAME_LEN; tail_len = font_name_len + QQ_SEND_IM_AFTER_MSG_HEADER_LEN + 1; @@ -553,11 +551,11 @@ /* 052-052: text message type (normal/auto-reply) */ bytes += create_packet_b(raw_data, &cursor, type); /* 053- : msg ends with 0x00 */ - bytes += create_packet_data(raw_data, &cursor, msg_filtered, msg_len); - guint8 *send_im_tail = qq_get_send_im_tail(font_color, font_size, font_name, is_bold, + bytes += create_packet_data(raw_data, &cursor, (guint8 *) msg_filtered, msg_len); + send_im_tail = qq_get_send_im_tail(font_color, font_size, font_name, is_bold, is_italic, is_underline, tail_len); _qq_show_packet("QQ_MESG debug", send_im_tail, tail_len); - bytes += create_packet_data(raw_data, &cursor, (gchar *) send_im_tail, tail_len); + bytes += create_packet_data(raw_data, &cursor, send_im_tail, tail_len); _qq_show_packet("QQ_MESG raw", raw_data, cursor - raw_data); Modified: trunk/src/protocols/qq/im.h =================================================================== --- trunk/src/protocols/qq/im.h 2006-08-06 18:19:36 UTC (rev 16656) +++ trunk/src/protocols/qq/im.h 2006-08-06 21:03:10 UTC (rev 16657) @@ -54,7 +54,7 @@ guint8 *qq_get_send_im_tail(const gchar *font_color, const gchar *font_size, const gchar *font_name, - gboolean is_bold, gboolean is_italic, gboolean is_underline, guint len); + gboolean is_bold, gboolean is_italic, gboolean is_underline, gint len); void qq_send_packet_im(GaimConnection *gc, guint32 to_uid, gchar *msg, gint type); void qq_process_recv_im(guint8 *buf, gint buf_len, guint16 seq, GaimConnection *gc); Modified: trunk/src/protocols/qq/qq_proxy.c =================================================================== --- trunk/src/protocols/qq/qq_proxy.c 2006-08-06 18:19:36 UTC (rev 16656) +++ trunk/src/protocols/qq/qq_proxy.c 2006-08-06 21:03:10 UTC (rev 16657) @@ -54,7 +54,7 @@ } */ -void _qq_show_packet(gchar *desc, gchar *buf, gint len) +void _qq_show_packet(const gchar *desc, const guint8 *buf, gint len) { char buf1[8*len+2], buf2[10]; int i; @@ -73,11 +73,11 @@ GaimCipher *cipher; GaimCipherContext *context; - gchar pwkey_tmp[QQ_KEY_LENGTH]; + guchar pwkey_tmp[QQ_KEY_LENGTH]; cipher = gaim_ciphers_find_cipher("md5"); context = gaim_cipher_context_new(cipher, NULL); - gaim_cipher_context_append(context, pwd, strlen(pwd)); + gaim_cipher_context_append(context, (guchar *) pwd, strlen(pwd)); gaim_cipher_context_digest(context, sizeof(pwkey_tmp), pwkey_tmp, NULL); gaim_cipher_context_destroy(context); context = gaim_cipher_context_new(cipher, NULL); Modified: trunk/src/protocols/qq/qq_proxy.h =================================================================== --- trunk/src/protocols/qq/qq_proxy.h 2006-08-06 18:19:36 UTC (rev 16656) +++ trunk/src/protocols/qq/qq_proxy.h 2006-08-06 21:03:10 UTC (rev 16657) @@ -46,8 +46,10 @@ gint qq_proxy_write(qq_data *qd, guint8 *data, gint len); gint qq_connect(GaimAccount *account, const gchar *host, guint16 port, gboolean use_tcp, gboolean is_redirect); - void qq_disconnect(GaimConnection *gc); -void _qq_show_packet(gchar *des, gchar *buf, gint len); +gint _qq_fill_host(struct sockaddr_in *addr, const gchar *host, guint16 port); + +void _qq_show_packet(const gchar *desc, const guint8 *buf, gint len); + #endif Modified: trunk/src/protocols/qq/send_file.c =================================================================== --- trunk/src/protocols/qq/send_file.c 2006-08-06 18:19:36 UTC (rev 16656) +++ trunk/src/protocols/qq/send_file.c 2006-08-06 21:03:10 UTC (rev 16657) @@ -269,7 +269,7 @@ } -extern gchar *_gen_session_md5(gint uid, gchar *session_key); +extern gchar *_gen_session_md5(gint uid, guint8 *session_key); /* fill in the common information of file transfer */ static gint _qq_create_packet_file_header Modified: trunk/src/protocols/qq/udp_proxy_s5.c =================================================================== --- trunk/src/protocols/qq/udp_proxy_s5.c 2006-08-06 18:19:36 UTC (rev 16656) +++ trunk/src/protocols/qq/udp_proxy_s5.c 2006-08-06 21:03:10 UTC (rev 16657) @@ -33,7 +33,7 @@ unsigned char buf[512]; struct PHB *phb = data; struct sockaddr_in sin; - int len; + int len, error; gaim_input_remove(phb->inpa); gaim_debug(GAIM_DEBUG_INFO, "socks5 proxy", "Able to read again.\n"); @@ -82,7 +82,7 @@ return; } - int error = ETIMEDOUT; + error = ETIMEDOUT; gaim_debug(GAIM_DEBUG_INFO, "QQ", "Connect didn't block\n"); len = sizeof(error); if (getsockopt(phb->udpsock, SOL_SOCKET, SO_ERROR, &error, &len) < 0) { @@ -209,12 +209,15 @@ static void _qq_s5_canread(gpointer data, gint source, GaimInputCondition cond) { unsigned char buf[512]; - struct PHB *phb = data; + struct PHB *phb; + int ret; + phb = data; + gaim_input_remove(phb->inpa); gaim_debug(GAIM_DEBUG_INFO, "socks5 proxy", "Able to read.\n"); - int ret = read(source, buf, 2); + ret = read(source, buf, 2); if (ret < 2) { gaim_debug(GAIM_DEBUG_INFO, "s5_canread", "packet smaller than 2 octet\n"); close(source); @@ -275,7 +278,7 @@ } } -void _qq_s5_canwrite(gpointer data, gint source, GaimInputCondition cond) +static void _qq_s5_canwrite(gpointer data, gint source, GaimInputCondition cond) { unsigned char buf[512]; int i; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2006-08-06 18:19:41
|
Revision: 16656 Author: markhuetsch Date: 2006-08-06 11:19:36 -0700 (Sun, 06 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16656&view=rev Log Message: ----------- Fixed a buffer overflow that occurred when showing large packets. 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-06 17:41:51 UTC (rev 16655) +++ trunk/src/protocols/qq/qq_proxy.c 2006-08-06 18:19:36 UTC (rev 16656) @@ -56,7 +56,7 @@ void _qq_show_packet(gchar *desc, gchar *buf, gint len) { - char buf1[4096], buf2[10]; + char buf1[8*len+2], buf2[10]; int i; buf1[0] = 0; for (i = 0; i < len; i++) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <may...@us...> - 2006-08-06 17:41:58
|
Revision: 16655 Author: mayuan2006 Date: 2006-08-06 10:41:51 -0700 (Sun, 06 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16655&view=rev Log Message: ----------- add a group add/del contact add/del/block/unblock SOAP Operation Framework Need to finish the content soon comitted by MaYuan<may...@gm...> Modified Paths: -------------- branches/soc-2006-msnp13/src/protocols/msn/contact.c branches/soc-2006-msnp13/src/protocols/msn/contact.h branches/soc-2006-msnp13/src/protocols/msn/history.c Modified: branches/soc-2006-msnp13/src/protocols/msn/contact.c =================================================================== --- branches/soc-2006-msnp13/src/protocols/msn/contact.c 2006-08-06 16:20:39 UTC (rev 16654) +++ branches/soc-2006-msnp13/src/protocols/msn/contact.c 2006-08-06 17:41:51 UTC (rev 16655) @@ -410,7 +410,7 @@ { gaim_debug_info("MaYuan","msn_get_address_book()...\n"); /*build SOAP and POST it*/ - contact->soapconn->login_path = g_strdup(MSN_GET_ADDRESS_POST_URL); + contact->soapconn->login_path = g_strdup(MSN_ADDRESS_BOOK_POST_URL); contact->soapconn->soap_action = g_strdup(MSN_GET_ADDRESS_SOAP_ACTION); msn_soap_post(contact->soapconn,MSN_GET_ADDRESS_TEMPLATE,msn_address_written_cb); } @@ -420,6 +420,12 @@ msn_add_contact(MsnContact *contact) { gaim_debug_info("MaYuan","msn add a contact...\n"); + + /*build SOAP and POST it*/ + contact->soapconn->login_path = g_strdup(MSN_ADDRESS_BOOK_POST_URL); + contact->soapconn->soap_action = g_strdup(MSN_CONTACT_ADD_SOAP_ACTION); + msn_soap_post(contact->soapconn,MSN_GET_ADDRESS_TEMPLATE,msn_address_written_cb); + } /*delete a Contact*/ @@ -427,6 +433,10 @@ msn_delete_contact(MsnContact *contact) { gaim_debug_info("MaYuan","msn delete a contact...\n"); + /*build SOAP and POST it*/ + contact->soapconn->login_path = g_strdup(MSN_ADDRESS_BOOK_POST_URL); + contact->soapconn->soap_action = g_strdup(MSN_GET_GLEAMS_SOAP_ACTION); + msn_soap_post(contact->soapconn,MSN_GLEAMS_TEMPLATE,msn_address_written_cb); } /*block a Contact*/ @@ -434,6 +444,10 @@ msn_block_contact(MsnContact *contact) { gaim_debug_info("MaYuan","msn block a contact...\n"); + /*build SOAP and POST it*/ + contact->soapconn->login_path = g_strdup(MSN_ADDRESS_BOOK_POST_URL); + contact->soapconn->soap_action = g_strdup(MSN_GET_GLEAMS_SOAP_ACTION); + msn_soap_post(contact->soapconn,MSN_GLEAMS_TEMPLATE,msn_address_written_cb); } /*unblock a contact*/ @@ -441,6 +455,10 @@ msn_unblock_contact(MsnContact *contact) { gaim_debug_info("MaYuan","msn unblock a contact...\n"); + /*build SOAP and POST it*/ + contact->soapconn->login_path = g_strdup(MSN_ADDRESS_BOOK_POST_URL); + contact->soapconn->soap_action = g_strdup(MSN_GET_GLEAMS_SOAP_ACTION); + msn_soap_post(contact->soapconn,MSN_GLEAMS_TEMPLATE,msn_address_written_cb); } /*get the gleams info*/ @@ -449,11 +467,33 @@ { gaim_debug_info("MaYuan","msn get gleams info...\n"); /*build SOAP and POST it*/ - contact->soapconn->login_path = g_strdup(MSN_GET_ADDRESS_POST_URL); - contact->soapconn->soap_action = g_strdup(MSN_GET_ADDRESS_SOAP_ACTION); + contact->soapconn->login_path = g_strdup(MSN_ADDRESS_BOOK_POST_URL); + contact->soapconn->soap_action = g_strdup(MSN_GET_GLEAMS_SOAP_ACTION); msn_soap_post(contact->soapconn,MSN_GLEAMS_TEMPLATE,msn_address_written_cb); } +void msn_add_group(MsnContact *contact) +{ + gaim_debug_info("MaYuan","msn add group...\n"); + + /*build SOAP and POST it*/ + contact->soapconn->login_path = g_strdup(MSN_ADDRESS_BOOK_POST_URL); + contact->soapconn->soap_action = g_strdup(MSN_GROUP_ADD_SOAP_ACTION); + msn_soap_post(contact->soapconn,MSN_GROUP_ADD_TEMPLATE,msn_address_written_cb); + +} + +void msn_del_group(MsnContact *contact) +{ + gaim_debug_info("MaYuan","msn del group...\n"); + + /*build SOAP and POST it*/ + contact->soapconn->login_path = g_strdup(MSN_ADDRESS_BOOK_POST_URL); + contact->soapconn->soap_action = g_strdup(MSN_GROUP_DEL_SOAP_ACTION); + msn_soap_post(contact->soapconn,MSN_GROUP_DEL_TEMPLATE,msn_address_written_cb); + +} + void msn_contact_connect(MsnContact *contact) { Modified: branches/soc-2006-msnp13/src/protocols/msn/contact.h =================================================================== --- branches/soc-2006-msnp13/src/protocols/msn/contact.h 2006-08-06 16:20:39 UTC (rev 16654) +++ branches/soc-2006-msnp13/src/protocols/msn/contact.h 2006-08-06 17:41:51 UTC (rev 16655) @@ -57,9 +57,12 @@ "</soap:Body>"\ "</soap:Envelope>" +/************************************************ + * Address Book SOAP + * *********************************************/ +#define MSN_ADDRESS_BOOK_POST_URL "/abservice/abservice.asmx" /*get addressbook soap request template*/ #define MSN_GET_ADDRESS_SOAP_ACTION "http://www.msn.com/webservices/AddressBook/ABFindAll" -#define MSN_GET_ADDRESS_POST_URL "/abservice/abservice.asmx" #define MSN_GET_ADDRESS_TEMPLATE "<?xml version=\"1.0\" encoding=\"utf-8\"?>"\ "<soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soapenc=\"http://schemas.xmlsoap.org/soap/encoding/\">"\ "<soap:Header>"\ @@ -81,6 +84,7 @@ "</soap:Envelope>" /*Gleams SOAP request template*/ +#define MSN_GET_GLEAMS_SOAP_ACTION "http://www.msn.com/webservices/AddressBook/ABFindAll" #define MSN_GLEAMS_TEMPLATE "<?xml version=\"1.0\" encoding=\"utf-8\"?>"\ "<soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soapenc=\"http://schemas.xmlsoap.org/soap/encoding/\">"\ "<soap:Header>"\ @@ -103,6 +107,9 @@ "</soap:Body>"\ "</soap:Envelope>" +/******************************************************* + * Contact Add/del SOAP Action + *******************************************************/ /*add conatct soap request*/ #define MSN_CONTACT_ADD_SOAP_ACTION "http://www.msn.com/webservices/AddressBook/ABContactAdd" #define MSN_CONTACT_XML "<Contact xmlns=\"http://www.msn.com/webservices/AddressBook\"><contactInfo><contactType>LivePending</contactType><passportName>%s</passportName><isMessengerUser>true</isMessengerUser></contactInfo></Contact>" @@ -116,7 +123,11 @@ #define MSN_MEMBER_TEMPLATE "<Member xsi:type=\"PassportMember\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"><Type>Passport</Type><State>Accepted</State><PassportName>%s</PassportName></Member>" +/******************************************************* + * Contact Block/Unblock SOAP Action + *******************************************************/ /*block means add contact to block list*/ +#define MSN_SHARE_POST_URL "/abservice/SharingService.asmx" #define MSN_CONTACT_BLOCK_SOAP_ACTION "http://www.msn.com/webservices/AddressBook/AddMember" #define MSN_BLOCK_CONTACT_TEMPLATE "<?xml version=\"1.0\" encoding=\"utf-8\"?><soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soapenc=\"http://schemas.xmlsoap.org/soap/encoding/\"><soap:Header><ABApplicationHeader xmlns=\"http://www.msn.com/webservices/AddressBook\"><ApplicationId>09607671-1C32-421F-A6A6-CBFAA51AB5F4</ApplicationId><IsMigration>false</IsMigration><PartnerScenario>BlockUnblock</PartnerScenario></ABApplicationHeader><ABAuthHeader xmlns=\"http://www.msn.com/webservices/AddressBook\"><ManagedGroupRequest>false</ManagedGroupRequest></ABAuthHeader></soap:Header><soap:Body><AddMember xmlns=\"http://www.msn.com/webservices/AddressBook\"><serviceHandle><Id>0</Id><Type>Messenger</Type><ForeignId></ForeignId></serviceHandle><memberships><Membership><MemberRole>Block</MemberRole><Members>%s</Members></Membership></memberships></AddMember></soap:Body></soap:Envelope>" @@ -124,6 +135,17 @@ #define MSN_CONTACT_UNBLOCK_SOAP_ACTION "http://www.msn.com/webservices/AddressBook/DeleteMember" #define MSN_UNBLOCK_CONTACT_TEMPLATE "<?xml version=\"1.0\" encoding=\"utf-8\"?><soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soapenc=\"http://schemas.xmlsoap.org/soap/encoding/\"><soap:Header><ABApplicationHeader xmlns=\"http://www.msn.com/webservices/AddressBook\"><ApplicationId>09607671-1C32-421F-A6A6-CBFAA51AB5F4</ApplicationId><IsMigration>false</IsMigration><PartnerScenario>BlockUnblock</PartnerScenario></ABApplicationHeader><ABAuthHeader xmlns=\"http://www.msn.com/webservices/AddressBook\"><ManagedGroupRequest>false</ManagedGroupRequest></ABAuthHeader></soap:Header><soap:Body><DeleteMember xmlns=\"http://www.msn.com/webservices/AddressBook\"><serviceHandle><Id>0</Id><Type>Messenger</Type><ForeignId></ForeignId></serviceHandle><memberships><Membership><MemberRole>Block</MemberRole><Members>%s</Members></Membership></memberships></DeleteMember></soap:Body></soap:Envelope>" +/******************************************************* + * Group SOAP Action + *******************************************************/ +/*add a group*/ +#define MSN_GROUP_ADD_SOAP_ACTION "http://www.msn.com/webservices/AddressBook/ABGroupAdd" +#define MSN_GROUP_ADD_TEMPLATE "<?xml version=\"1.0\" encoding=\"utf-8\"?><soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soapenc=\"http://schemas.xmlsoap.org/soap/encoding/\"><soap:Header><ABApplicationHeader xmlns=\"http://www.msn.com/webservices/AddressBook\"><ApplicationId>09607671-1C32-421F-A6A6-CBFAA51AB5F4</ApplicationId><IsMigration>false</IsMigration><PartnerScenario>GroupSave</PartnerScenario></ABApplicationHeader><ABAuthHeader xmlns=\"http://www.msn.com/webservices/AddressBook\"><ManagedGroupRequest>false</ManagedGroupRequest></ABAuthHeader></soap:Header><soap:Body><ABGroupAdd xmlns=\"http://www.msn.com/webservices/AddressBook\"><abId>00000000-0000-0000-0000-000000000000</abId><groupAddOptions><fRenameOnMsgrConflict>false</fRenameOnMsgrConflict></groupAddOptions><groupInfo><GroupInfo><name>%s</name><groupType>C8529CE2-6EAD-434d-881F-341E17DB3FF8</groupType><fMessenger>false</fMessenger><annotations><Annotation><Name>MSN.IM.Display</Name><Value>1</Value></Annotation></annotations></GroupInfo></groupInfo></ABGroupAdd></soap:Body></soap:Envelope>" + +/*delete a group*/ +#define MSN_GROUP_DEL_SOAP_ACTION "http://www.msn.com/webservices/AddressBook/ABGroupDelete" +#define MSN_GROUP_DEL_TEMPLATE "<?xml version=\"1.0\" encoding=\"utf-8\"?><soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soapenc=\"http://schemas.xmlsoap.org/soap/encoding/\"><soap:Header><ABApplicationHeader xmlns=\"http://www.msn.com/webservices/AddressBook\"><ApplicationId>09607671-1C32-421F-A6A6-CBFAA51AB5F4</ApplicationId><IsMigration>false</IsMigration><PartnerScenario>Timer</PartnerScenario></ABApplicationHeader><ABAuthHeader xmlns=\"http://www.msn.com/webservices/AddressBook\"><ManagedGroupRequest>false</ManagedGroupRequest></ABAuthHeader></soap:Header><soap:Body><ABGroupDelete xmlns=\"http://www.msn.com/webservices/AddressBook\"><abId>00000000-0000-0000-0000-000000000000</abId><groupFilter><groupIds><guid>%s</guid></groupIds></groupFilter></ABGroupDelete></soap:Body></soap:Envelope>" + typedef struct _MsnContact MsnContact; struct _MsnContact Modified: branches/soc-2006-msnp13/src/protocols/msn/history.c =================================================================== --- branches/soc-2006-msnp13/src/protocols/msn/history.c 2006-08-06 16:20:39 UTC (rev 16654) +++ branches/soc-2006-msnp13/src/protocols/msn/history.c 2006-08-06 17:41:51 UTC (rev 16655) @@ -84,3 +84,4 @@ msn_transaction_destroy(trans); } } + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <may...@us...> - 2006-08-06 16:20:53
|
Revision: 16654 Author: mayuan2006 Date: 2006-08-06 09:20:39 -0700 (Sun, 06 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16654&view=rev Log Message: ----------- can show the Photo info sucessfully! committed by MaYuan<may...@gm...> Modified Paths: -------------- branches/soc-2006-msnp13/src/protocols/msn/msn.c branches/soc-2006-msnp13/src/protocols/msn/msn.h Modified: branches/soc-2006-msnp13/src/protocols/msn/msn.c =================================================================== --- branches/soc-2006-msnp13/src/protocols/msn/msn.c 2006-08-06 15:16:46 UTC (rev 16653) +++ branches/soc-2006-msnp13/src/protocols/msn/msn.c 2006-08-06 16:20:39 UTC (rev 16654) @@ -1390,12 +1390,10 @@ { char *p, *q; - if ((p = strstr(url_text, " contactparams:photopreauthurl=\"")) != NULL) - { - p += strlen(" contactparams:photopreauthurl=\""); + if ((p = strstr(url_text, PHOTO_URL)) != NULL){ + p += strlen(PHOTO_URL); } - - if (p && (strncmp(p, "http://", 8) == 0) && ((q = strchr(p, '"')) != NULL)) + if (p && (strncmp(p, "http://",strlen("http://")) == 0) && ((q = strchr(p, '"')) != NULL)) return g_strndup(p, q - p); return NULL; @@ -1809,6 +1807,7 @@ #if PHOTO_SUPPORT /* Find the URL to the photo; must be before the marshalling [Bug 994207] */ photo_url_text = msn_get_photo_url(url_text); + gaim_debug_info("Ma Yuan","photo url:{%s}\n",photo_url_text); /* Marshall the existing state */ info2_data = g_malloc0(sizeof(MsnGetInfoStepTwoData)); Modified: branches/soc-2006-msnp13/src/protocols/msn/msn.h =================================================================== --- branches/soc-2006-msnp13/src/protocols/msn/msn.h 2006-08-06 15:16:46 UTC (rev 16653) +++ branches/soc-2006-msnp13/src/protocols/msn/msn.h 2006-08-06 16:20:39 UTC (rev 16654) @@ -79,6 +79,7 @@ #define PASSPORT_URL "http://lc1.law13.hotmail.passport.com/cgi-bin/dologin?login=" /*#define PROFILE_URL "http://spaces.msn.com/profile.aspx?mem="*/ #define PROFILE_URL "http://spaces.live.com/profile.aspx?mem=" +#define PHOTO_URL " contactparams:photopreauthurl=\"" #define USEROPT_HOTMAIL 0 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <may...@us...> - 2006-08-06 15:17:03
|
Revision: 16653 Author: mayuan2006 Date: 2006-08-06 08:16:46 -0700 (Sun, 06 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16653&view=rev Log Message: ----------- a version can show the windows Live ID's Info correctly ready to send the oim,need to check committed by Ma Yuan<may...@gm...> Modified Paths: -------------- branches/soc-2006-msnp13/src/protocols/msn/group.h branches/soc-2006-msnp13/src/protocols/msn/msn.c branches/soc-2006-msnp13/src/protocols/msn/msn.h 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/slp.c branches/soc-2006-msnp13/src/protocols/msn/soap.c branches/soc-2006-msnp13/src/protocols/msn/switchboard.c branches/soc-2006-msnp13/src/protocols/msn/userlist.c Modified: branches/soc-2006-msnp13/src/protocols/msn/group.h =================================================================== --- branches/soc-2006-msnp13/src/protocols/msn/group.h 2006-08-05 17:45:13 UTC (rev 16652) +++ branches/soc-2006-msnp13/src/protocols/msn/group.h 2006-08-06 15:16:46 UTC (rev 16653) @@ -40,7 +40,7 @@ #define MSN_GROUP_IDS "<guid>9e57e654-59f0-44d1-aedc-0a7500b7e51f</guid>" #define MSN_DELETE_GROUP_TEMPLATE "<?xml version=\"1.0\" encoding=\"utf-8\"?><soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soapenc=\"http://schemas.xmlsoap.org/soap/encoding/\"><soap:Header><ABApplicationHeader xmlns=\"http://www.msn.com/webservices/AddressBook\"><ApplicationId>09607671-1C32-421F-A6A6-CBFAA51AB5F4</ApplicationId><IsMigration>false</IsMigration><PartnerScenario>Timer</PartnerScenario></ABApplicationHeader><ABAuthHeader xmlns=\"http://www.msn.com/webservices/AddressBook\"><ManagedGroupRequest>false</ManagedGroupRequest></ABAuthHeader></soap:Header><soap:Body><ABGroupDelete xmlns=\"http://www.msn.com/webservices/AddressBook\"><abId>00000000-0000-0000-0000-000000000000</abId><groupFilter><groupIds>%s</groupIds></groupFilter></ABGroupDelete></soap:Body></soap:Envelope>" -#define MSN_INDIVIDUALS_GROUP_ID "123" +#define MSN_INDIVIDUALS_GROUP_ID "1983" #define MSN_INDIVIDUALS_GROUP_NAME "Other Contacts" #define MSN_NON_IM_GROUP_ID "email" Modified: branches/soc-2006-msnp13/src/protocols/msn/msn.c =================================================================== --- branches/soc-2006-msnp13/src/protocols/msn/msn.c 2006-08-05 17:45:13 UTC (rev 16652) +++ branches/soc-2006-msnp13/src/protocols/msn/msn.c 2006-08-06 15:16:46 UTC (rev 16653) @@ -565,6 +565,8 @@ (user->list_op & (1 << MSN_LIST_BL)) ? _("Yes") : _("No")); } + + gaim_debug_info("MaYuan","tooltip string:{%s}\n",str); } static GList * @@ -778,6 +780,7 @@ char *msgformat; char *msgtext; + gaim_debug_info("MaYuan","send IM {%s}\n",message); account = gaim_connection_get_account(gc); msn_import_html(message, &msgformat, &msgtext); @@ -1373,6 +1376,7 @@ "\n", "<br>"); g_string_free(str, TRUE); g_string_append_printf(s, "%s<br>", tmp); +// gaim_debug_info("MaYuan","tooltip info string:{%s}\n",s); g_free(tmp); } @@ -1414,7 +1418,7 @@ #define MSN_GOT_INFO_GET_FIELD(a, b) \ found = gaim_markup_extract_info_field(stripped, stripped_len, s, \ - "\n" a "\t", 0, "\n", 0, "Undisclosed", b, 0, NULL, NULL); \ + "\n" a ":\t", 0, "\n", 0, "Undisclosed", b, 0, NULL, NULL); \ if (found) \ sect_info = TRUE; @@ -1440,7 +1444,7 @@ MsnGetInfoStepTwoData *info2_data = NULL; #endif - gaim_debug_info("msn", "In msn_got_info\n"); + gaim_debug_info("msn", "In msn_got_info,url_text:{%s}\n",url_text); /* Make sure the connection is still valid */ if (g_list_find(gaim_connections_get_all(), info_data->gc) == NULL) Modified: branches/soc-2006-msnp13/src/protocols/msn/msn.h =================================================================== --- branches/soc-2006-msnp13/src/protocols/msn/msn.h 2006-08-05 17:45:13 UTC (rev 16652) +++ branches/soc-2006-msnp13/src/protocols/msn/msn.h 2006-08-06 15:16:46 UTC (rev 16653) @@ -77,7 +77,8 @@ #define HOTMAIL_URL "http://www.hotmail.com/cgi-bin/folders" #define PASSPORT_URL "http://lc1.law13.hotmail.passport.com/cgi-bin/dologin?login=" -#define PROFILE_URL "http://spaces.msn.com/profile.aspx?mem=" +/*#define PROFILE_URL "http://spaces.msn.com/profile.aspx?mem="*/ +#define PROFILE_URL "http://spaces.live.com/profile.aspx?mem=" #define USEROPT_HOTMAIL 0 Modified: branches/soc-2006-msnp13/src/protocols/msn/notification.c =================================================================== --- branches/soc-2006-msnp13/src/protocols/msn/notification.c 2006-08-05 17:45:13 UTC (rev 16652) +++ branches/soc-2006-msnp13/src/protocols/msn/notification.c 2006-08-06 15:16:46 UTC (rev 16653) @@ -1357,6 +1357,7 @@ g_hash_table_destroy(table); } +/*offline Message notification process*/ static void initial_mdata_msg(MsnCmdProc *cmdproc, MsnMessage *msg) { @@ -1599,10 +1600,15 @@ msn_table_add_msg_type(cbs_table, "text/x-msmsgsprofile", profile_msg); + /*initial OIM notification*/ msn_table_add_msg_type(cbs_table, "text/x-msmsgsinitialmdatanotification", initial_mdata_msg); + /*OIM notification when user online*/ msn_table_add_msg_type(cbs_table, + "text/x-msmsgsoimnotification", + initial_mdata_msg); + msn_table_add_msg_type(cbs_table, "text/x-msmsgsinitialemailnotification", initial_email_msg); msn_table_add_msg_type(cbs_table, @@ -1618,3 +1624,4 @@ { msn_table_destroy(cbs_table); } + Modified: branches/soc-2006-msnp13/src/protocols/msn/oim.c =================================================================== --- branches/soc-2006-msnp13/src/protocols/msn/oim.c 2006-08-05 17:45:13 UTC (rev 16652) +++ branches/soc-2006-msnp13/src/protocols/msn/oim.c 2006-08-06 15:16:46 UTC (rev 16653) @@ -181,7 +181,7 @@ MsnSoapConn * soapconn = data; MsnOim * msnoim; - gaim_debug_info("MaYuan","read buffer:{%s}\n",soapconn->body); + gaim_debug_info("MaYuan","OIM get read buffer:{%s}\n",soapconn->body); } static void @@ -296,12 +296,13 @@ msn_oim_get_connect_cb, msn_oim_get_error_cb); } - +#if 0 if(msn_soap_connected(oim->sendconn) == -1){ msn_soap_init(oim->sendconn,MSN_OIM_SEND_HOST,1, msn_oim_send_connect_cb, msn_oim_send_error_cb); } +#endif } /*endof oim.c*/ Modified: branches/soc-2006-msnp13/src/protocols/msn/slp.c =================================================================== --- branches/soc-2006-msnp13/src/protocols/msn/slp.c 2006-08-05 17:45:13 UTC (rev 16652) +++ branches/soc-2006-msnp13/src/protocols/msn/slp.c 2006-08-06 15:16:46 UTC (rev 16653) @@ -33,6 +33,8 @@ /* ms to delay between sending buddy icon requests to the server. */ #define BUDDY_ICON_DELAY 20000 +/*debug SLP*/ +#define MSN_DEBUG_UD static void send_ok(MsnSlpCall *slpcall, const char *branch, const char *type, const char *content); Modified: branches/soc-2006-msnp13/src/protocols/msn/soap.c =================================================================== --- branches/soc-2006-msnp13/src/protocols/msn/soap.c 2006-08-05 17:45:13 UTC (rev 16652) +++ branches/soc-2006-msnp13/src/protocols/msn/soap.c 2006-08-06 15:16:46 UTC (rev 16653) @@ -102,9 +102,12 @@ void msn_soap_destroy(MsnSoapConn *soapconn) { - g_free(soapconn->login_host); - g_free(soapconn->login_path); + if(soapconn->login_host) + g_free(soapconn->login_host); + if(soapconn->login_path) + g_free(soapconn->login_path); + /*remove the write handler*/ if (soapconn->output_handler > 0){ gaim_input_remove(soapconn->output_handler); Modified: branches/soc-2006-msnp13/src/protocols/msn/switchboard.c =================================================================== --- branches/soc-2006-msnp13/src/protocols/msn/switchboard.c 2006-08-05 17:45:13 UTC (rev 16652) +++ branches/soc-2006-msnp13/src/protocols/msn/switchboard.c 2006-08-06 15:16:46 UTC (rev 16653) @@ -29,6 +29,8 @@ #include "error.h" +#define MSN_DEBUG_SB + static MsnTable *cbs_table; static void msg_error_helper(MsnCmdProc *cmdproc, MsnMessage *msg, @@ -615,6 +617,7 @@ g_return_if_fail(swboard != NULL); g_return_if_fail(msg != NULL); + gaim_debug_info("Ma Yuan","switchboard send msg..\n"); if (msn_switchboard_can_send(swboard)) release_msg(swboard, msg); else if (queue) @@ -1051,6 +1054,8 @@ cal_error(MsnCmdProc *cmdproc, MsnTransaction *trans, int error) { int reason = MSN_SB_ERROR_UNKNOWN; + MsnMessage *msg; + MsnSwitchBoard *swboard = trans->data; if (error == 215) { @@ -1063,7 +1068,19 @@ } gaim_debug_warning("msn", "cal_error: command %s gave error %i\n", trans->command, error); + gaim_debug_warning("msn", "Will Use Offline Message to sendit\n"); +// cal_error_helper(trans, reason); + /*offline Message send Process*/ + + while ((msg = g_queue_pop_head(swboard->msg_queue)) != NULL){ + gaim_debug_warning("Ma Yuan","offline msg to send:{%s}\n",msg->body); + /* The messages could not be sent due to a switchboard error */ + swboard->error = MSN_SB_ERROR_USER_OFFLINE; + msg_error_helper(swboard->cmdproc, msg, + MSN_MSG_ERROR_SB); + msn_message_unref(msg); + } cal_error_helper(trans, reason); } Modified: branches/soc-2006-msnp13/src/protocols/msn/userlist.c =================================================================== --- branches/soc-2006-msnp13/src/protocols/msn/userlist.c 2006-08-05 17:45:13 UTC (rev 16652) +++ branches/soc-2006-msnp13/src/protocols/msn/userlist.c 2006-08-06 15:16:46 UTC (rev 16653) @@ -617,6 +617,7 @@ msn_notification_rem_buddy(userlist->session->notification, list, who, group_id); } +/*add buddy*/ void msn_userlist_add_buddy(MsnUserList *userlist, const char *who, int list_id, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <the...@us...> - 2006-08-05 17:45:16
|
Revision: 16652 Author: thekingant Date: 2006-08-05 10:45:13 -0700 (Sat, 05 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16652&view=rev Log Message: ----------- Remove some references to Napster on the webpage, too Modified Paths: -------------- web/htdocs/faq2.txt web/htdocs/protocol.php web/htdocs/statusicons.php Modified: web/htdocs/faq2.txt =================================================================== --- web/htdocs/faq2.txt 2006-08-05 17:44:56 UTC (rev 16651) +++ web/htdocs/faq2.txt 2006-08-05 17:45:13 UTC (rev 16652) @@ -1133,7 +1133,7 @@ Q: Did you guys reverse engineer it? -A: Jabber, MSN, Napster, and IRC are published protocols, so we +A: Jabber, MSN and IRC are published protocols, so we didn't have to reverse engineer those. Oscar, ICQ, and Yahoo are not published, and were reverse engineered by other people. Novell was provided by Novell, and SILC was written by one of the developers of Modified: web/htdocs/protocol.php =================================================================== --- web/htdocs/protocol.php 2006-08-05 17:44:56 UTC (rev 16651) +++ web/htdocs/protocol.php 2006-08-05 17:45:13 UTC (rev 16652) @@ -10,7 +10,6 @@ <li><a href="#irc">IRC</a></li> <li><a href="#jabber">Jabber</a></li> <li><a href="#msn">MSN</a></li> - <li><a href="#napster">Napster</a></li> <li><a href="#Novell">Novell GroupWise</a></li> <li><a href="#oscar">Oscar ("AIM/ICQ")</a></li> <li><a href="#Sametime">Lotus Sametime</a></li> @@ -122,18 +121,6 @@ be reverse engineered to work. Some documentation on this effort is available <a href="http://www.hypothetic.org/docs/msn/index.php">here</a>.</p> -<a name="napster"></a> -<h2>Napster</h2> -<p> -Ahh, Napster. The music sharing network that started it all. Gaim does -not support sharing files over Napster. With that out of the way, what -does Gaim support? Instant messages and buddy list notification. We are -not aware of anyone that actually uses this... but it does work. You can -get a free Napster Server from -<a href="http://opennap.sourceforge.net/">http://opennap.sourceforge.net/</a>. -They distribute Windows binaries. I'm not sure if it compiles in Linux. -</p> - <a name="Novell"></a> <h2>Novell</h2> <p> Modified: web/htdocs/statusicons.php =================================================================== --- web/htdocs/statusicons.php 2006-08-05 17:44:56 UTC (rev 16651) +++ web/htdocs/statusicons.php 2006-08-05 17:45:13 UTC (rev 16652) @@ -78,14 +78,6 @@ ) ), - "Napster" => array( - "ID" => "napster", - - "ICONS" => array( - "Online / Available" => "online.png" - ) - ), - "Yahoo!" => array( "ID" => "yahoo", This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <the...@us...> - 2006-08-05 17:44:59
|
Revision: 16651 Author: thekingant Date: 2006-08-05 10:44:56 -0700 (Sat, 05 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16651&view=rev Log Message: ----------- Backport SVN revision #16650 from HEAD to v2_0_0 Original commit message: Remove "Napster" from a few more places ViewCVS Links: ------------- http://svn.sourceforge.net/gaim/?rev=16650&view=rev Modified Paths: -------------- branches/v2_0_0/Makefile.mingw branches/v2_0_0/doc/gaim.1.in branches/v2_0_0/gaim.spec.in branches/v2_0_0/src/gtkdialogs.c Modified: branches/v2_0_0/Makefile.mingw =================================================================== --- branches/v2_0_0/Makefile.mingw 2006-08-05 17:40:38 UTC (rev 16650) +++ branches/v2_0_0/Makefile.mingw 2006-08-05 17:44:56 UTC (rev 16651) @@ -54,7 +54,6 @@ TOC_TYPE = PLUGIN IRC_TYPE = PLUGIN JABBER_TYPE = PLUGIN -NAPSTER_TYPE = PLUGIN GG_TYPE = PLUGIN NOVELL_TYPE = PLUGIN SILC_TYPE = PLUGIN @@ -68,7 +67,6 @@ $(MAKE) TYPE='$(MSN_TYPE)' -C $(MSN) -f Makefile.mingw $(MAKE) TYPE='$(IRC_TYPE)' -C $(IRC) -f Makefile.mingw $(MAKE) TYPE='$(JABBER_TYPE)' -C $(JABBER) -f Makefile.mingw - $(MAKE) TYPE='$(NAPSTER_TYPE)' -C $(NAPSTER) -f Makefile.mingw $(MAKE) TYPE='$(GG_TYPE)' -C $(GG) -f Makefile.mingw $(MAKE) TYPE='$(NOVELL_TYPE)' -C $(NOVELL) -f Makefile.mingw $(MAKE) TYPE='$(SILC_TYPE)' -C $(SILC) -f Makefile.mingw @@ -90,7 +88,6 @@ $(MAKE) TYPE='$(MSN_TYPE)' -C $(MSN) -f Makefile.mingw install $(MAKE) TYPE='$(IRC_TYPE)' -C $(IRC) -f Makefile.mingw install $(MAKE) TYPE='$(JABBER_TYPE)' -C $(JABBER) -f Makefile.mingw install - $(MAKE) TYPE='$(NAPSTER_TYPE)' -C $(NAPSTER) -f Makefile.mingw install $(MAKE) TYPE='$(GG_TYPE)' -C $(GG) -f Makefile.mingw install $(MAKE) TYPE='$(NOVELL_TYPE)' -C $(NOVELL) -f Makefile.mingw install $(MAKE) TYPE='$(SILC_TYPE)' -C $(SILC) -f Makefile.mingw install @@ -118,7 +115,6 @@ $(MAKE) -C $(MSN) -f Makefile.mingw clean $(MAKE) -C $(IRC) -f Makefile.mingw clean $(MAKE) -C $(JABBER) -f Makefile.mingw clean - $(MAKE) -C $(NAPSTER) -f Makefile.mingw clean $(MAKE) -C $(GG) -f Makefile.mingw clean $(MAKE) -C $(NOVELL) -f Makefile.mingw clean $(MAKE) -C $(SILC) -f Makefile.mingw clean Modified: branches/v2_0_0/doc/gaim.1.in =================================================================== --- branches/v2_0_0/doc/gaim.1.in 2006-08-05 17:40:38 UTC (rev 16650) +++ branches/v2_0_0/doc/gaim.1.in 2006-08-05 17:44:56 UTC (rev 16651) @@ -30,7 +30,7 @@ .PP \fBgaim\fR is a GTK2-based Instant Messaging (IM) application. It supports multiple protocols via modules, including AIM, ICQ, Yahoo!, MSN, Jabber, -IRC, Napster, Gadu-Gadu and Zephyr. It has many common features found in +IRC, Gadu-Gadu and Zephyr. It has many common features found in other clients, as well as many unique features. Gaim is not endorsed by or affiliated with America Online, ICQ, Microsoft, or Yahoo. Modified: branches/v2_0_0/gaim.spec.in =================================================================== --- branches/v2_0_0/gaim.spec.in 2006-08-05 17:40:38 UTC (rev 16650) +++ branches/v2_0_0/gaim.spec.in 2006-08-05 17:44:56 UTC (rev 16651) @@ -112,7 +112,7 @@ %description Gaim allows you to talk to anyone using a variety of messaging protocols, including AIM, ICQ, IRC, Yahoo!, Novell Groupwise, MSN -Messenger, Jabber, Gadu-Gadu, Napster, Lotus Sametime and Zephyr. +Messenger, Jabber, Gadu-Gadu, Lotus Sametime and Zephyr. These protocols are implemented using a modular, easy to use design. To use a protocol, just add an account using the account editor. Modified: branches/v2_0_0/src/gtkdialogs.c =================================================================== --- branches/v2_0_0/src/gtkdialogs.c 2006-08-05 17:40:38 UTC (rev 16650) +++ branches/v2_0_0/src/gtkdialogs.c 2006-08-05 17:44:56 UTC (rev 16651) @@ -268,7 +268,7 @@ g_string_append(str, _("Gaim is a modular messaging client capable of using " "AIM, MSN, Yahoo!, Jabber, ICQ, IRC, SILC, " - "Novell GroupWise, Lotus Sametime, Napster, Zephyr, and Gadu-Gadu " + "Novell GroupWise, Lotus Sametime, Zephyr, and Gadu-Gadu " "all at once. It is written using GTK+.<BR><BR>" "You may modify and redistribute the program under " "the terms of the GPL (version 2 or later). A copy of the GPL is " This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <the...@us...> - 2006-08-05 17:40:58
|
Revision: 16650 Author: thekingant Date: 2006-08-05 10:40:38 -0700 (Sat, 05 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16650&view=rev Log Message: ----------- Remove "Napster" from a few more places Modified Paths: -------------- trunk/Makefile.mingw trunk/doc/gaim.1.in trunk/doc/gntgaim.1.in trunk/gaim.spec.in trunk/src/gtkdialogs.c Modified: trunk/Makefile.mingw =================================================================== --- trunk/Makefile.mingw 2006-08-05 17:34:37 UTC (rev 16649) +++ trunk/Makefile.mingw 2006-08-05 17:40:38 UTC (rev 16650) @@ -54,7 +54,6 @@ TOC_TYPE = PLUGIN IRC_TYPE = PLUGIN JABBER_TYPE = PLUGIN -NAPSTER_TYPE = PLUGIN GG_TYPE = PLUGIN NOVELL_TYPE = PLUGIN SILC_TYPE = PLUGIN @@ -68,7 +67,6 @@ $(MAKE) TYPE='$(MSN_TYPE)' -C $(MSN) -f Makefile.mingw $(MAKE) TYPE='$(IRC_TYPE)' -C $(IRC) -f Makefile.mingw $(MAKE) TYPE='$(JABBER_TYPE)' -C $(JABBER) -f Makefile.mingw - $(MAKE) TYPE='$(NAPSTER_TYPE)' -C $(NAPSTER) -f Makefile.mingw $(MAKE) TYPE='$(GG_TYPE)' -C $(GG) -f Makefile.mingw $(MAKE) TYPE='$(NOVELL_TYPE)' -C $(NOVELL) -f Makefile.mingw $(MAKE) TYPE='$(SILC_TYPE)' -C $(SILC) -f Makefile.mingw @@ -90,7 +88,6 @@ $(MAKE) TYPE='$(MSN_TYPE)' -C $(MSN) -f Makefile.mingw install $(MAKE) TYPE='$(IRC_TYPE)' -C $(IRC) -f Makefile.mingw install $(MAKE) TYPE='$(JABBER_TYPE)' -C $(JABBER) -f Makefile.mingw install - $(MAKE) TYPE='$(NAPSTER_TYPE)' -C $(NAPSTER) -f Makefile.mingw install $(MAKE) TYPE='$(GG_TYPE)' -C $(GG) -f Makefile.mingw install $(MAKE) TYPE='$(NOVELL_TYPE)' -C $(NOVELL) -f Makefile.mingw install $(MAKE) TYPE='$(SILC_TYPE)' -C $(SILC) -f Makefile.mingw install @@ -118,7 +115,6 @@ $(MAKE) -C $(MSN) -f Makefile.mingw clean $(MAKE) -C $(IRC) -f Makefile.mingw clean $(MAKE) -C $(JABBER) -f Makefile.mingw clean - $(MAKE) -C $(NAPSTER) -f Makefile.mingw clean $(MAKE) -C $(GG) -f Makefile.mingw clean $(MAKE) -C $(NOVELL) -f Makefile.mingw clean $(MAKE) -C $(SILC) -f Makefile.mingw clean Modified: trunk/doc/gaim.1.in =================================================================== --- trunk/doc/gaim.1.in 2006-08-05 17:34:37 UTC (rev 16649) +++ trunk/doc/gaim.1.in 2006-08-05 17:40:38 UTC (rev 16650) @@ -30,7 +30,7 @@ .PP \fBgaim\fR is a GTK2-based Instant Messaging (IM) application. It supports multiple protocols via modules, including AIM, ICQ, Yahoo!, MSN, Jabber, -IRC, Napster, Gadu-Gadu and Zephyr. It has many common features found in +IRC, Gadu-Gadu and Zephyr. It has many common features found in other clients, as well as many unique features. Gaim is not endorsed by or affiliated with America Online, ICQ, Microsoft, or Yahoo. Modified: trunk/doc/gntgaim.1.in =================================================================== --- trunk/doc/gntgaim.1.in 2006-08-05 17:34:37 UTC (rev 16649) +++ trunk/doc/gntgaim.1.in 2006-08-05 17:40:38 UTC (rev 16650) @@ -30,7 +30,7 @@ .PP \fBgntgaim\fR is a console-based frontend for Instant Messaging (IM) application Gaim. It supports multiple protocols via modules, including AIM, -ICQ, Yahoo!, MSN, Jabber, IRC, Napster, Gadu-Gadu and Zephyr. It has many +ICQ, Yahoo!, MSN, Jabber, IRC, Gadu-Gadu and Zephyr. It has many common features found in other clients, as well as many unique features. Gaim is not endorsed by or affiliated with America Online, ICQ, Microsoft, or Yahoo. Modified: trunk/gaim.spec.in =================================================================== --- trunk/gaim.spec.in 2006-08-05 17:34:37 UTC (rev 16649) +++ trunk/gaim.spec.in 2006-08-05 17:40:38 UTC (rev 16650) @@ -112,7 +112,7 @@ %description Gaim allows you to talk to anyone using a variety of messaging protocols, including AIM, ICQ, IRC, Yahoo!, Novell Groupwise, MSN -Messenger, Jabber, Gadu-Gadu, Napster, Lotus Sametime and Zephyr. +Messenger, Jabber, Gadu-Gadu, Lotus Sametime and Zephyr. These protocols are implemented using a modular, easy to use design. To use a protocol, just add an account using the account editor. Modified: trunk/src/gtkdialogs.c =================================================================== --- trunk/src/gtkdialogs.c 2006-08-05 17:34:37 UTC (rev 16649) +++ trunk/src/gtkdialogs.c 2006-08-05 17:40:38 UTC (rev 16650) @@ -268,7 +268,7 @@ g_string_append(str, _("Gaim is a modular messaging client capable of using " "AIM, MSN, Yahoo!, Jabber, ICQ, IRC, SILC, " - "Novell GroupWise, Lotus Sametime, Napster, Zephyr, and Gadu-Gadu " + "Novell GroupWise, Lotus Sametime, Zephyr, and Gadu-Gadu " "all at once. It is written using GTK+.<BR><BR>" "You may modify and redistribute the program under " "the terms of the GPL (version 2 or later). A copy of the GPL is " This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <amc...@us...> - 2006-08-05 17:34:55
|
Revision: 16649 Author: amc_grim Date: 2006-08-05 10:34:37 -0700 (Sat, 05 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16649&view=rev Log Message: ----------- Making another branch since svn won't let me merge with a working copy... Added Paths: ----------- branches/restructure-v2_0_0/ Copied: branches/restructure-v2_0_0 (from rev 16648, branches/v2_0_0) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2006-08-05 17:04:58
|
Revision: 16648 Author: sadrul Date: 2006-08-05 10:04:47 -0700 (Sat, 05 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16648&view=rev Log Message: ----------- Do not give focus to new windows. Instead, set the urgent-hint for them. Modified Paths: -------------- trunk/console/gntblist.c trunk/console/libgnt/gntcombobox.c trunk/console/libgnt/gntmain.c trunk/console/libgnt/gntwidget.h Modified: trunk/console/gntblist.c =================================================================== --- trunk/console/gntblist.c 2006-08-05 11:31:54 UTC (rev 16647) +++ trunk/console/gntblist.c 2006-08-05 17:04:47 UTC (rev 16648) @@ -679,6 +679,7 @@ gnt_widget_set_position(box, x, y); GNT_WIDGET_UNSET_FLAGS(box, GNT_WIDGET_CAN_TAKE_FOCUS); + GNT_WIDGET_SET_FLAGS(box, GNT_WIDGET_TRANSIENT); gnt_widget_draw(box); g_free(title); Modified: trunk/console/libgnt/gntcombobox.c =================================================================== --- trunk/console/libgnt/gntcombobox.c 2006-08-05 11:31:54 UTC (rev 16647) +++ trunk/console/libgnt/gntcombobox.c 2006-08-05 17:04:47 UTC (rev 16648) @@ -129,6 +129,7 @@ widget->priv.y - 9 + 1, widget->priv.x); } + GNT_WIDGET_SET_FLAGS(parent, GNT_WIDGET_TRANSIENT); gnt_widget_draw(parent); return TRUE; } Modified: trunk/console/libgnt/gntmain.c =================================================================== --- trunk/console/libgnt/gntmain.c 2006-08-05 11:31:54 UTC (rev 16647) +++ trunk/console/libgnt/gntmain.c 2006-08-05 17:04:47 UTC (rev 16648) @@ -67,7 +67,7 @@ /* XXX: ew */ focus_list = g_list_first(focus_list); focus_list = g_list_append(focus_list, widget); - focus_list = g_list_find(focus_list, widget); + focus_list = g_list_find(focus_list, w ? w : widget); gnt_widget_set_focus(widget, TRUE); if (w) @@ -757,7 +757,14 @@ gnt_box_sync_children(GNT_BOX(widget)); node = g_hash_table_lookup(nodes, widget); if (node && !node->panel) + { node->panel = new_panel(node->me->window); + if (!GNT_WIDGET_IS_FLAG_SET(node->me, GNT_WIDGET_TRANSIENT)) + { + bottom_panel(node->panel); /* New windows should not grab focus */ + gnt_widget_set_urgent(node->me); + } + } if (window_list.window) { Modified: trunk/console/libgnt/gntwidget.h =================================================================== --- trunk/console/libgnt/gntwidget.h 2006-08-05 11:31:54 UTC (rev 16647) +++ trunk/console/libgnt/gntwidget.h 2006-08-05 17:04:47 UTC (rev 16648) @@ -40,6 +40,7 @@ GNT_WIDGET_GROW_X = 1 << 8, GNT_WIDGET_GROW_Y = 1 << 9, GNT_WIDGET_INVISIBLE = 1 << 10, + GNT_WIDGET_TRANSIENT = 1 << 11, } GntWidgetFlags; /* XXX: I'll have to ask grim what he's using this for in guifications. */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2006-08-05 11:32:06
|
Revision: 16647 Author: sadrul Date: 2006-08-05 04:31:54 -0700 (Sat, 05 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16647&view=rev Log Message: ----------- Statusbox comes in. It's now possible to change the account status. There's nothing yet for creating custom statuses. It's also possible now to delete accounts. Modified Paths: -------------- trunk/console/gntaccount.c trunk/console/gntblist.c trunk/console/libgnt/gntbox.c trunk/console/libgnt/gntbox.h trunk/console/libgnt/gntcombobox.c trunk/console/libgnt/gntentry.c trunk/console/libgnt/test/tv.c Modified: trunk/console/gntaccount.c =================================================================== --- trunk/console/gntaccount.c 2006-08-05 10:05:07 UTC (rev 16646) +++ trunk/console/gntaccount.c 2006-08-05 11:31:54 UTC (rev 16647) @@ -49,6 +49,9 @@ GntWidget *remember; } AccountEditDialog; +/* This is necessary to close an edit-dialog when an account is deleted */ +static GList *accountdialogs; + static void account_add(GaimAccount *account) { @@ -64,6 +67,7 @@ static void edit_dialog_destroy(AccountEditDialog *dialog) { + accountdialogs = g_list_remove(accountdialogs, dialog); g_list_free(dialog->prpl_entries); g_list_free(dialog->split_entries); g_free(dialog); @@ -143,7 +147,6 @@ gaim_account_set_password(account, NULL); /* Mail notification */ - /* XXX: Only if the protocol has anything to do with emails */ gaim_account_set_check_mail(account, gnt_check_box_get_checked(GNT_CHECK_BOX(dialog->newmail))); @@ -426,7 +429,19 @@ GList *list, *iter; AccountEditDialog *dialog; + if (account) + { + GList *iter; + for (iter = accountdialogs; iter; iter = iter->next) + { + AccountEditDialog *dlg = iter->data; + if (dlg->account == account) + return; + } + } + dialog = g_new0(AccountEditDialog, 1); + accountdialogs = g_list_prepend(accountdialogs, dialog); dialog->window = window = gnt_box_new(FALSE, TRUE); dialog->account = account; @@ -534,10 +549,38 @@ } static void +really_delete_account(GaimAccount *account) +{ + GList *iter; + for (iter = accountdialogs; iter; iter = iter->next) + { + AccountEditDialog *dlg = iter->data; + if (dlg->account == account) + { + gnt_widget_destroy(dlg->window); + break; + } + } + gaim_accounts_delete(account); +} + +static void delete_account_cb(GntWidget *widget, GntTree *tree) { - /* XXX: After the request-api is complete */ - /* Note: remove the modify-dialog for the account */ + GaimAccount *account; + char *prompt; + + account = gnt_tree_get_selection_data(tree); + if (!account) + return; + + prompt = g_strdup_printf(_("Are you sure you want to delete %s?"), + gaim_account_get_username(account)); + + gaim_request_close_with_handle(account); /* Close any other opened delete window */ + gaim_request_action(account, _("Delete Account"), prompt, NULL, 0, account, 2, + _("Delete"), really_delete_account, _("Cancel"), NULL); + g_free(prompt); } static void Modified: trunk/console/gntblist.c =================================================================== --- trunk/console/gntblist.c 2006-08-05 10:05:07 UTC (rev 16646) +++ trunk/console/gntblist.c 2006-08-05 11:31:54 UTC (rev 16647) @@ -1,19 +1,25 @@ #include <account.h> #include <blist.h> #include <request.h> +#include <savedstatuses.h> #include <server.h> #include <signal.h> +#include <status.h> #include <util.h> #include "gntgaim.h" #include "gntbox.h" +#include "gntcombobox.h" +#include "gntentry.h" #include "gntlabel.h" +#include "gntline.h" #include "gnttree.h" #include "gntblist.h" #include <string.h> #define PREF_ROOT "/gaim/gnt/blist" +#define TYPING_TIMEOUT 4000 typedef struct { @@ -25,8 +31,29 @@ GntWidget *context; GaimBlistNode *cnode; + + /* XXX: I am KISSing */ + GntWidget *status; /* Dropdown with the statuses */ + GntWidget *statustext; /* Status message */ + int typing; } GGBlist; +typedef enum +{ + STATUS_PRIMITIVE = 0, + STATUS_SAVED +} StatusType; + +typedef struct +{ + StatusType type; + union + { + GaimStatusPrimitive prim; + GaimSavedStatus *saved; + } u; +} StatusBoxItem; + GGBlist *ggblist; static void add_buddy(GaimBuddy *buddy, GGBlist *ggblist); @@ -34,6 +61,7 @@ static void add_chat(GaimChat *chat, GGBlist *ggblist); static void add_node(GaimBlistNode *node, GGBlist *ggblist); static void draw_tooltip(GGBlist *ggblist); +static void remove_typing_cb(gpointer null); static void remove_peripherals(GGBlist *ggblist); static const char * get_display_name(GaimBlistNode *node); @@ -113,7 +141,7 @@ { } -static GaimBlistUiOps blist_ui_ops = +static GaimBlistUiOps blist_ui_ops = { new_list, new_node, @@ -202,6 +230,8 @@ GaimBlistNode *node = (GaimBlistNode *)chat; if (node->ui_data) return; + if (!gaim_account_is_connected(chat->account)) + return; group = gaim_chat_get_group(chat); add_node((GaimBlistNode*)group, ggblist); @@ -290,7 +320,7 @@ GList *list; if (action == NULL) return; - + gnt_tree_add_row_after(tree, action, gnt_tree_create_row(tree, action->label), parent, NULL); for (list = action->children; list; list = list->next) @@ -367,7 +397,7 @@ add_custom_action(tree, _("View Log"), GAIM_CALLBACK(gg_blist_view_log_cb)), buddy); #endif - + /* Protocol actions */ append_proto_menu(tree, gaim_account_get_connection(gaim_buddy_get_account(buddy)), @@ -436,9 +466,9 @@ name = ((GaimGroup*)node)->name; else g_return_if_reached(); - + prompt = g_strdup_printf(_("Please enter the new name for %s"), name); - + gaim_request_input(node, _("Rename"), prompt, _("Enter empty string to reset the name."), name, FALSE, FALSE, NULL, _("Rename"), G_CALLBACK(rename_blist_node), _("Cancel"), NULL, node); @@ -682,7 +712,7 @@ ret = gnt_widget_key_pressed(ggblist->context, text); stop = TRUE; } - + if (text[0] == 27) { if (strcmp(text + 1, GNT_KEY_POPUP) == 0) @@ -760,7 +790,8 @@ node->ui_data = NULL; node = gaim_blist_node_next(node, TRUE); } - + + remove_typing_cb(NULL); remove_peripherals(ggblist); g_free(ggblist); ggblist = NULL; @@ -777,10 +808,55 @@ while (node) { node_update(list, node); - node = gaim_blist_node_next(node, TRUE); + node = gaim_blist_node_next(node, FALSE); } } +static void +destroy_status_list(GList *list) +{ + g_list_foreach(list, (GFunc)g_free, NULL); + g_list_free(list); +} + +static void +populate_status_dropdown() +{ + int i; + GList *iter; + GList *items = NULL; + + /* First the primitives */ + GaimStatusPrimitive prims[] = {GAIM_STATUS_AVAILABLE, GAIM_STATUS_AWAY, + GAIM_STATUS_INVISIBLE, GAIM_STATUS_OFFLINE, GAIM_STATUS_UNSET}; + + for (i = 0; prims[i] != GAIM_STATUS_UNSET; i++) + { + StatusBoxItem *item = g_new0(StatusBoxItem, 1); + item->type = STATUS_PRIMITIVE; + item->u.prim = prims[i]; + items = g_list_prepend(items, item); + gnt_combo_box_add_data(GNT_COMBO_BOX(ggblist->status), item, + gaim_primitive_get_name_from_type(prims[i])); + } + + /* 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->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)); + } + + /* 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); +} + void gg_blist_init() { gaim_prefs_add_none(PREF_ROOT); @@ -796,6 +872,120 @@ return; } +static void +remove_typing_cb(gpointer null) +{ + GaimSavedStatus *current; + const char *message, *newmessage; + GaimStatusPrimitive prim, newprim; + StatusBoxItem *item; + + current = gaim_savedstatus_get_current(); + message = gaim_savedstatus_get_message(current); + prim = gaim_savedstatus_get_type(current); + + newmessage = gnt_entry_get_text(GNT_ENTRY(ggblist->statustext)); + item = gnt_combo_box_get_selected_data(GNT_COMBO_BOX(ggblist->status)); + g_return_if_fail(item->type == STATUS_PRIMITIVE); + newprim = item->u.prim; + + if (newprim != prim || ((message && !newmessage) || + (!message && newmessage) || + (message && newmessage && g_utf8_collate(message, newmessage) != 0))) + { + GaimSavedStatus *status = gaim_savedstatus_find_transient_by_type_and_message(newprim, newmessage); + /* Holy Crap! That's a LAWNG function name */ + if (status == NULL) + { + status = gaim_savedstatus_new(NULL, newprim); + gaim_savedstatus_set_message(status, newmessage); + } + + gaim_savedstatus_activate(status); + } + + gnt_box_give_focus_to_child(GNT_BOX(ggblist->window), ggblist->tree); + g_source_remove(ggblist->typing); + ggblist->typing = 0; +} + +static void +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) + { + /* Set the status immediately */ + gaim_savedstatus_activate(now->u.saved); + } + else if (now->type == STATUS_PRIMITIVE) + { + /* Move the focus to the entry box */ + gnt_box_move_focus(GNT_BOX(ggblist->window), 1); + ggblist->typing = g_timeout_add(TYPING_TIMEOUT, (GSourceFunc)remove_typing_cb, NULL); + } + else + g_return_if_reached(); +} + +static gboolean +status_text_changed(GntEntry *entry, const char *text, gpointer null) +{ + if (text[0] == 27 && ggblist->typing == 0) + return FALSE; + + g_source_remove(ggblist->typing); + ggblist->typing = 0; + + if (text[0] == '\r' && text[1] == 0) + { + /* Set the status only after you press 'Enter' */ + remove_typing_cb(NULL); + return TRUE; + } + + ggblist->typing = g_timeout_add(TYPING_TIMEOUT, (GSourceFunc)remove_typing_cb, NULL); + return FALSE; +} + +static void +savedstatus_changed(GaimSavedStatus *now, GaimSavedStatus *old) +{ + /* Block the signals we don't want to emit */ + GList *list; + GaimStatusPrimitive prim; + const char *message; + + if (!ggblist) + return; + + g_signal_handlers_block_matched(ggblist->status, G_SIGNAL_MATCH_FUNC, + 0, 0, NULL, status_selection_changed, NULL); + g_signal_handlers_block_matched(ggblist->statustext, G_SIGNAL_MATCH_FUNC, + 0, 0, NULL, status_text_changed, NULL); + + prim = gaim_savedstatus_get_type(now); + message = gaim_savedstatus_get_message(now); + + list = g_object_get_data(G_OBJECT(ggblist->status), "list of statuses"); + for (; list; list = list->next) + { + StatusBoxItem *item = list->data; + if (item->type == STATUS_PRIMITIVE && item->u.prim == prim) + { + gnt_combo_box_set_selected(GNT_COMBO_BOX(ggblist->status), item); + gnt_entry_set_text(GNT_ENTRY(ggblist->statustext), message); + gnt_widget_draw(ggblist->status); + break; + } + } + + g_signal_handlers_unblock_matched(ggblist->status, G_SIGNAL_MATCH_FUNC, + 0, 0, NULL, status_selection_changed, NULL); + g_signal_handlers_unblock_matched(ggblist->statustext, G_SIGNAL_MATCH_FUNC, + 0, 0, NULL, status_text_changed, NULL); +} + void gg_blist_show() { if (ggblist) @@ -805,7 +995,7 @@ gaim_get_blist()->ui_data = ggblist; - ggblist->window = gnt_box_new(FALSE, FALSE); + ggblist->window = gnt_vbox_new(FALSE); gnt_widget_set_name(ggblist->window, "buddylist"); gnt_box_set_toplevel(GNT_BOX(ggblist->window), TRUE); gnt_box_set_title(GNT_BOX(ggblist->window), _("Buddy List")); @@ -820,13 +1010,23 @@ gaim_prefs_get_int(PREF_ROOT "/position/y")); gnt_box_add_widget(GNT_BOX(ggblist->window), ggblist->tree); + + gnt_box_add_widget(GNT_BOX(ggblist->window), gnt_hline_new()); + + ggblist->status = gnt_combo_box_new(); + gnt_box_add_widget(GNT_BOX(ggblist->window), ggblist->status); + ggblist->statustext = gnt_entry_new(NULL); + gnt_box_add_widget(GNT_BOX(ggblist->window), ggblist->statustext); + + populate_status_dropdown(); + gnt_widget_show(ggblist->window); gaim_signal_connect(gaim_blist_get_handle(), "buddy-status-changed", gg_blist_get_handle(), GAIM_CALLBACK(buddy_status_changed), ggblist); gaim_signal_connect(gaim_blist_get_handle(), "buddy-idle-changed", gg_blist_get_handle(), GAIM_CALLBACK(buddy_idle_changed), ggblist); - + #if 0 gaim_signal_connect(gaim_blist_get_handle(), "buddy-signed-on", gg_blist_get_handle(), GAIM_CALLBACK(buddy_signed_on), ggblist); @@ -854,7 +1054,17 @@ g_signal_connect(G_OBJECT(ggblist->window), "position_set", G_CALLBACK(save_position_cb), NULL); g_signal_connect(G_OBJECT(ggblist->window), "destroy", G_CALLBACK(reset_blist_window), NULL); + /* Status signals */ + gaim_signal_connect(gaim_savedstatuses_get_handle(), "savedstatus-changed", gg_blist_get_handle(), + GAIM_CALLBACK(savedstatus_changed), NULL); + g_signal_connect(G_OBJECT(ggblist->status), "selection_changed", + G_CALLBACK(status_selection_changed), NULL); + g_signal_connect(G_OBJECT(ggblist->statustext), "key_pressed", + G_CALLBACK(status_text_changed), NULL); + populate_buddylist(); + + savedstatus_changed(gaim_savedstatus_get_current(), NULL); } void gg_blist_uninit() Modified: trunk/console/libgnt/gntbox.c =================================================================== --- trunk/console/libgnt/gntbox.c 2006-08-05 10:05:07 UTC (rev 16646) +++ trunk/console/libgnt/gntbox.c 2006-08-05 11:31:54 UTC (rev 16647) @@ -245,6 +245,28 @@ } while (box->active != last); } +static void +find_prev_focus(GntBox *box) +{ + gpointer last = box->active; + + if (!box->focus) + return; + + do + { + GList *iter = g_list_find(box->focus, box->active); + if (!iter) + box->active = box->focus->data; + else if (!iter->prev) + box->active = g_list_last(box->focus)->data; + else + box->active = iter->prev->data; + if (!GNT_WIDGET_IS_FLAG_SET(box->active, GNT_WIDGET_INVISIBLE)) + break; + } while (box->active != last); +} + static gboolean gnt_box_key_pressed(GntWidget *widget, const char *text) { @@ -263,15 +285,7 @@ { if (strcmp(text+1, GNT_KEY_LEFT) == 0) { - GList *iter = g_list_find(box->focus, box->active); - if ((!iter || !iter->prev) && box->focus) - { - box->active = box->focus->data; - } - else - { - box->active = iter->prev->data; - } + find_prev_focus(box); } else if (strcmp(text+1, GNT_KEY_RIGHT) == 0) { @@ -689,3 +703,46 @@ box->fill = fill; } +void gnt_box_move_focus(GntBox *box, int dir) +{ + GntWidget *now; + + if (box->active == NULL) + { + find_focusable_widget(box); + return; + } + + now = box->active; + + if (dir == 1) + find_next_focus(box); + else if (dir == -1) + find_prev_focus(box); + + if (now && now != box->active) + { + gnt_widget_set_focus(now, FALSE); + gnt_widget_set_focus(box->active, TRUE); + } + + if (GNT_WIDGET(box)->window) + gnt_widget_draw(GNT_WIDGET(box)); +} + +void gnt_box_give_focus_to_child(GntBox *box, GntWidget *widget) +{ + GList *find = g_list_find(box->focus, widget); + gpointer now = box->active; + if (find) + box->active = widget; + if (now && now != box->active) + { + gnt_widget_set_focus(now, FALSE); + gnt_widget_set_focus(box->active, TRUE); + } + + if (GNT_WIDGET(box)->window) + gnt_widget_draw(GNT_WIDGET(box)); +} + Modified: trunk/console/libgnt/gntbox.h =================================================================== --- trunk/console/libgnt/gntbox.h 2006-08-05 10:05:07 UTC (rev 16646) +++ trunk/console/libgnt/gntbox.h 2006-08-05 11:31:54 UTC (rev 16647) @@ -88,6 +88,10 @@ void gnt_box_set_fill(GntBox *box, gboolean fill); +void gnt_box_move_focus(GntBox *box, int dir); /* +1 to move forward, -1 for backward */ + +void gnt_box_give_focus_to_child(GntBox *box, GntWidget *widget); + G_END_DECLS #endif /* GNT_BOX_H */ Modified: trunk/console/libgnt/gntcombobox.c =================================================================== --- trunk/console/libgnt/gntcombobox.c 2006-08-05 10:05:07 UTC (rev 16646) +++ trunk/console/libgnt/gntcombobox.c 2006-08-05 11:31:54 UTC (rev 16647) @@ -23,11 +23,11 @@ /* XXX: make sure the key actually does exist */ gpointer old = box->selected; box->selected = key; - g_signal_emit(box, signals[SIG_SELECTION_CHANGED], 0, old, key); if (GNT_WIDGET(box)->window) gnt_widget_draw(GNT_WIDGET(box)); if (box->dropdown) gnt_tree_set_selected(GNT_TREE(box->dropdown), key); + g_signal_emit(box, signals[SIG_SELECTION_CHANGED], 0, old, key); } } @@ -65,7 +65,7 @@ } mvwprintw(widget->window, 1, 1, text); - whline(widget->window, '\0' | COLOR_PAIR(type), widget->priv.width - 4 - len); + whline(widget->window, ' ' | COLOR_PAIR(type), widget->priv.width - 4 - len); mvwaddch(widget->window, 1, widget->priv.width - 3, ACS_VLINE | COLOR_PAIR(GNT_COLOR_NORMAL)); mvwaddch(widget->window, 1, widget->priv.width - 2, ACS_DARROW | COLOR_PAIR(GNT_COLOR_NORMAL)); Modified: trunk/console/libgnt/gntentry.c =================================================================== --- trunk/console/libgnt/gntentry.c 2006-08-05 10:05:07 UTC (rev 16646) +++ trunk/console/libgnt/gntentry.c 2006-08-05 11:31:54 UTC (rev 16647) @@ -16,8 +16,9 @@ { GntEntry *entry = GNT_ENTRY(widget); int stop; + gboolean focus; - if (gnt_widget_has_focus(widget)) + if ((focus = gnt_widget_has_focus(widget))) wbkgdset(widget->window, '\0' | COLOR_PAIR(GNT_COLOR_TEXT_NORMAL)); else wbkgdset(widget->window, '\0' | COLOR_PAIR(GNT_COLOR_HIGHLIGHT_D)); @@ -34,8 +35,9 @@ if (stop < widget->priv.width) mvwhline(widget->window, 0, stop, ENTRY_CHAR, widget->priv.width - stop); - mvwchgat(widget->window, 0, g_utf8_pointer_to_offset(entry->scroll, entry->cursor), 1, - A_REVERSE, COLOR_PAIR(GNT_COLOR_TEXT_NORMAL), NULL); + if (focus) + mvwchgat(widget->window, 0, g_utf8_pointer_to_offset(entry->scroll, entry->cursor), + 1, A_REVERSE, COLOR_PAIR(GNT_COLOR_TEXT_NORMAL), NULL); DEBUG; } Modified: trunk/console/libgnt/test/tv.c =================================================================== --- trunk/console/libgnt/test/tv.c 2006-08-05 10:05:07 UTC (rev 16646) +++ trunk/console/libgnt/test/tv.c 2006-08-05 11:31:54 UTC (rev 16647) @@ -16,7 +16,8 @@ GNT_TEXT_FLAG_HIGHLIGHT); gnt_text_view_next_line(GNT_TEXT_VIEW(view)); gnt_entry_clear(GNT_ENTRY(w)); - gnt_text_view_scroll(GNT_TEXT_VIEW(view), 0); + if (gnt_text_view_get_lines_below(GNT_TEXT_VIEW(view)) <= 1) + gnt_text_view_scroll(GNT_TEXT_VIEW(view), 0); return TRUE; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <the...@us...> - 2006-08-05 10:05:13
|
Revision: 16646 Author: thekingant Date: 2006-08-05 03:05:07 -0700 (Sat, 05 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16646&view=rev Log Message: ----------- Backport SVN revisions 16530, 16533 and 16534 from HEAD to v2_0_0 These are memleak fixes from sadrul Modified Paths: -------------- branches/v2_0_0/src/gtkconv.c branches/v2_0_0/src/gtknotify.c branches/v2_0_0/src/notify.c Modified: branches/v2_0_0/src/gtkconv.c =================================================================== --- branches/v2_0_0/src/gtkconv.c 2006-08-05 09:54:33 UTC (rev 16645) +++ branches/v2_0_0/src/gtkconv.c 2006-08-05 10:05:07 UTC (rev 16646) @@ -411,6 +411,7 @@ g_string_append_printf(s, "%s, ", (char *)l->data); else g_string_append_printf(s, "%s.", (char *)l->data); + g_list_free(text); } gaim_conversation_write(conv, NULL, s->str, GAIM_MESSAGE_NO_LOG, time(NULL)); Modified: branches/v2_0_0/src/gtknotify.c =================================================================== --- branches/v2_0_0/src/gtknotify.c 2006-08-05 09:54:33 UTC (rev 16645) +++ branches/v2_0_0/src/gtknotify.c 2006-08-05 10:05:07 UTC (rev 16646) @@ -53,6 +53,7 @@ GtkWidget *treeview; GtkWidget *window; gpointer user_data; + GaimNotifySearchResults *results; } GaimNotifySearchResultsData; @@ -115,7 +116,7 @@ if (id == GTK_RESPONSE_YES) { GtkTreeSelection *selection; - + selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(dialog->treeview)); if (gtk_tree_selection_get_selected(selection, NULL, &iter)) @@ -191,6 +192,8 @@ button = bd->button; button->callback(gaim_account_get_connection(data->account), row, data->user_data); + g_list_foreach(row, (GFunc)g_free, NULL); + g_list_free(row); } static void * @@ -682,6 +685,7 @@ data = g_malloc(sizeof(GaimNotifySearchResultsData)); data->user_data = user_data; + data->results = results; /* Create the window */ window = gtk_window_new(GTK_WINDOW_TOPLEVEL); @@ -758,7 +762,7 @@ gaim_notify_searchresults_column_get_title(results, i-1), renderer, "text", i, NULL); } - + /* Setup the button area */ button_area = gtk_hbutton_box_new(); gtk_box_pack_start(GTK_BOX(vbox), button_area, FALSE, FALSE, 0); @@ -810,6 +814,8 @@ g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(searchresults_callback_wrapper_cb), bd); + g_signal_connect_swapped(G_OBJECT(button), "destroy", + G_CALLBACK(g_free), bd); } } @@ -862,6 +868,7 @@ GaimNotifySearchResultsData *data = (GaimNotifySearchResultsData *)ui_handle; gtk_widget_destroy(data->window); + gaim_notify_searchresults_free(data->results); g_free(data); } Modified: branches/v2_0_0/src/notify.c =================================================================== --- branches/v2_0_0/src/notify.c 2006-08-05 09:54:33 UTC (rev 16645) +++ branches/v2_0_0/src/notify.c 2006-08-05 10:05:07 UTC (rev 16646) @@ -200,6 +200,7 @@ for (l = results->buttons; l; l = g_list_delete_link(l, l)) { GaimNotifySearchButton *button = l->data; + g_free(button->label); g_free(button); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |