You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(106) |
Oct
(334) |
Nov
(246) |
Dec
(145) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(42) |
Feb
(53) |
Mar
(232) |
Apr
(109) |
May
(137) |
Jun
(63) |
Jul
(26) |
Aug
(263) |
Sep
(193) |
Oct
(507) |
Nov
(440) |
Dec
(241) |
2003 |
Jan
(567) |
Feb
(195) |
Mar
(504) |
Apr
(481) |
May
(524) |
Jun
(522) |
Jul
(594) |
Aug
(502) |
Sep
(643) |
Oct
(508) |
Nov
(430) |
Dec
(377) |
2004 |
Jan
(361) |
Feb
(251) |
Mar
(219) |
Apr
(499) |
May
(461) |
Jun
(419) |
Jul
(314) |
Aug
(519) |
Sep
(416) |
Oct
(247) |
Nov
(305) |
Dec
(382) |
2005 |
Jan
(267) |
Feb
(282) |
Mar
(327) |
Apr
(338) |
May
(189) |
Jun
(400) |
Jul
(462) |
Aug
(530) |
Sep
(316) |
Oct
(523) |
Nov
(481) |
Dec
(650) |
2006 |
Jan
(536) |
Feb
(361) |
Mar
(287) |
Apr
(146) |
May
(101) |
Jun
(169) |
Jul
(221) |
Aug
(498) |
Sep
(300) |
Oct
(236) |
Nov
(209) |
Dec
(205) |
2007 |
Jan
(30) |
Feb
(23) |
Mar
(26) |
Apr
(15) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <fac...@us...> - 2006-12-02 23:10:38
|
Revision: 17883 http://svn.sourceforge.net/gaim/?rev=17883&view=rev Author: faceprint Date: 2006-12-02 15:01:02 -0800 (Sat, 02 Dec 2006) Log Message: ----------- compile first, commit second Modified Paths: -------------- trunk/libgaim/protocols/jabber/parser.c Modified: trunk/libgaim/protocols/jabber/parser.c =================================================================== --- trunk/libgaim/protocols/jabber/parser.c 2006-12-02 22:58:59 UTC (rev 17882) +++ trunk/libgaim/protocols/jabber/parser.c 2006-12-02 23:01:02 UTC (rev 17883) @@ -26,6 +26,7 @@ #include "debug.h" #include "jabber.h" #include "parser.h" +#include "util.h" #include "xmlnode.h" static void This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fac...@us...> - 2006-12-02 23:07:48
|
Revision: 17881 http://svn.sourceforge.net/gaim/?rev=17881&view=rev Author: faceprint Date: 2006-12-02 14:58:10 -0800 (Sat, 02 Dec 2006) Log Message: ----------- this has been pissing me off at work Modified Paths: -------------- trunk/libgaim/protocols/jabber/chat.c Modified: trunk/libgaim/protocols/jabber/chat.c =================================================================== --- trunk/libgaim/protocols/jabber/chat.c 2006-12-02 22:31:49 UTC (rev 17880) +++ trunk/libgaim/protocols/jabber/chat.c 2006-12-02 22:58:10 UTC (rev 17881) @@ -963,6 +963,8 @@ if(!(query = xmlnode_get_child(packet, "query"))) return; + /* disabling this until more MUC servers support + * announcing this chat->xhtml = FALSE; for(x = xmlnode_get_child(query, "feature"); x; x = xmlnode_get_next_twin(x)) { @@ -972,6 +974,7 @@ chat->xhtml = TRUE; } } + */ } void jabber_chat_disco_traffic(JabberChat *chat) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fac...@us...> - 2006-12-02 22:59:07
|
Revision: 17882 http://svn.sourceforge.net/gaim/?rev=17882&view=rev Author: faceprint Date: 2006-12-02 14:58:59 -0800 (Sat, 02 Dec 2006) Log Message: ----------- fix the jabber parser's handling of attributes Modified Paths: -------------- trunk/libgaim/protocols/jabber/parser.c Modified: trunk/libgaim/protocols/jabber/parser.c =================================================================== --- trunk/libgaim/protocols/jabber/parser.c 2006-12-02 22:58:10 UTC (rev 17881) +++ trunk/libgaim/protocols/jabber/parser.c 2006-12-02 22:58:59 UTC (rev 17882) @@ -72,10 +72,14 @@ xmlnode_set_namespace(node, (const char*) namespace); for(i=0; i < nb_attributes * 5; i+=5) { + char *txt; int attrib_len = attributes[i+4] - attributes[i+3]; char *attrib = g_malloc(attrib_len + 1); memcpy(attrib, attributes[i+3], attrib_len); attrib[attrib_len] = '\0'; + txt = attrib; + attrib = gaim_unescape_html(txt); + g_free(txt); xmlnode_set_attrib(node, (const char*) attributes[i], attrib); g_free(attrib); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ebl...@us...> - 2006-12-02 22:31:58
|
Revision: 17880 http://svn.sourceforge.net/gaim/?rev=17880&view=rev Author: eblanton Date: 2006-12-02 14:31:49 -0800 (Sat, 02 Dec 2006) Log Message: ----------- gaim_util_fetch_url callback has changed, apparently Modified Paths: -------------- trunk/ChangeLog.API Modified: trunk/ChangeLog.API =================================================================== --- trunk/ChangeLog.API 2006-12-02 21:24:10 UTC (rev 17879) +++ trunk/ChangeLog.API 2006-12-02 22:31:49 UTC (rev 17880) @@ -127,6 +127,9 @@ * gaim_url_fetch(): Renamed to gaim_util_fetch_url() and changed to return a pointer to a data structure that can be used to cancel the pending HTTP request using gaim_util_fetch_url_cancel(). + Corresponding callback has changed to accept this data structure + as its first argument, and to accept an error message as an + additional final argument. * gaim_gtk_create_imhtml(): Added sw_ret() parameter * gaim_account_get_log(): Added create parameter * GAIM_CMD_P_VERYHIGH is now GAIM_CMD_P_VERY_HIGH This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fac...@us...> - 2006-12-02 21:24:22
|
Revision: 17879 http://svn.sourceforge.net/gaim/?rev=17879&view=rev Author: faceprint Date: 2006-12-02 13:24:10 -0800 (Sat, 02 Dec 2006) Log Message: ----------- oops, forgot a file Added Paths: ----------- trunk/libgaim/tests/test_jabber_jutil.c Added: trunk/libgaim/tests/test_jabber_jutil.c =================================================================== --- trunk/libgaim/tests/test_jabber_jutil.c (rev 0) +++ trunk/libgaim/tests/test_jabber_jutil.c 2006-12-02 21:24:10 UTC (rev 17879) @@ -0,0 +1,85 @@ +#include "tests.h" +#include "../protocols/jabber/jutil.h" + +START_TEST(test_get_resource) +{ + assert_string_equal_free("baz", jabber_get_resource("foo@bar/baz")); + assert_string_equal_free("baz", jabber_get_resource("bar/baz")); + assert_string_equal_free("baz/bat", jabber_get_resource("foo@bar/baz/bat")); + assert_string_equal_free("baz/bat", jabber_get_resource("bar/baz/bat")); +} +END_TEST + +START_TEST(test_get_resource_no_resource) +{ + + fail_unless(NULL == jabber_get_resource("foo@bar")); + fail_unless(NULL == jabber_get_resource("bar")); +} +END_TEST + +START_TEST(test_get_bare_jid) +{ + assert_string_equal_free("foo@bar", jabber_get_bare_jid("foo@bar")); + assert_string_equal_free("foo@bar", jabber_get_bare_jid("foo@bar/baz")); + assert_string_equal_free("bar", jabber_get_bare_jid("bar")); + assert_string_equal_free("bar", jabber_get_bare_jid("bar/baz")); +} +END_TEST + +START_TEST(test_nodeprep_validate) +{ + fail_unless(jabber_nodeprep_validate(NULL)); + fail_unless(jabber_nodeprep_validate("foo")); + fail_unless(jabber_nodeprep_validate("%d")); + fail_unless(jabber_nodeprep_validate("y\\z")); + + char *longnode = g_strnfill(1023, 'a'); + fail_unless(jabber_nodeprep_validate(longnode)); + g_free(longnode); +} +END_TEST + +START_TEST(test_nodeprep_validate_illegal_chars) +{ + fail_if(jabber_nodeprep_validate("don't")); + fail_if(jabber_nodeprep_validate("m@ke")); + fail_if(jabber_nodeprep_validate("\"me\"")); + fail_if(jabber_nodeprep_validate("&ngry")); + fail_if(jabber_nodeprep_validate("c:")); + fail_if(jabber_nodeprep_validate("a/b")); + fail_if(jabber_nodeprep_validate("4>2")); + fail_if(jabber_nodeprep_validate("4<7")); +} +END_TEST + +START_TEST(test_nodeprep_validate_too_long) +{ + char *longnode = g_strnfill(1024, 'a'); + fail_if(jabber_nodeprep_validate(longnode)); + g_free(longnode); +} +END_TEST + +Suite * +jabber_jutil_suite(void) +{ + Suite *s = suite_create("Jabber Utility Functions"); + + TCase *tc = tcase_create("Get Resource"); + tcase_add_test(tc, test_get_resource); + tcase_add_test(tc, test_get_resource_no_resource); + suite_add_tcase(s, tc); + + tc = tcase_create("Get Bare JID"); + tcase_add_test(tc, test_get_bare_jid); + suite_add_tcase(s, tc); + + tc = tcase_create("Nodeprep validate"); + tcase_add_test(tc, test_nodeprep_validate); + tcase_add_test(tc, test_nodeprep_validate_illegal_chars); + tcase_add_test(tc, test_nodeprep_validate_too_long); + suite_add_tcase(s, tc); + + return s; +} Property changes on: trunk/libgaim/tests/test_jabber_jutil.c ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fac...@us...> - 2006-12-02 21:12:22
|
Revision: 17878 http://svn.sourceforge.net/gaim/?rev=17878&view=rev Author: faceprint Date: 2006-12-02 13:12:20 -0800 (Sat, 02 Dec 2006) Log Message: ----------- continuing to add tests...now for jabber Modified Paths: -------------- trunk/libgaim/tests/Makefile.am trunk/libgaim/tests/check_libgaim.c trunk/libgaim/tests/tests.h Modified: trunk/libgaim/tests/Makefile.am =================================================================== --- trunk/libgaim/tests/Makefile.am 2006-12-02 19:57:47 UTC (rev 17877) +++ trunk/libgaim/tests/Makefile.am 2006-12-02 21:12:20 UTC (rev 17878) @@ -7,17 +7,20 @@ check_libgaim.c \ tests.h \ test_cipher.c \ + test_jabber_jutil.c \ test_util.c \ $(top_builddir)/libgaim/util.h check_libgaim_CFLAGS=\ @CHECK_CFLAGS@ \ $(GLIB_CFLAGS) \ + -I.. \ -DBUILDDIR=\"$(top_builddir)\" check_libgaim_LDADD=\ @CHECK_LIBS@ \ $(GLIB_LIBS) \ + $(top_builddir)/libgaim/protocols/jabber/libjabber.la \ $(top_builddir)/libgaim/libgaim.la endif Modified: trunk/libgaim/tests/check_libgaim.c =================================================================== --- trunk/libgaim/tests/check_libgaim.c 2006-12-02 19:57:47 UTC (rev 17877) +++ trunk/libgaim/tests/check_libgaim.c 2006-12-02 21:12:20 UTC (rev 17878) @@ -54,8 +54,9 @@ int number_failed; SRunner *sr = srunner_create (master_suite()); + srunner_add_suite(sr, cipher_suite()); + srunner_add_suite(sr, jabber_jutil_suite()); srunner_add_suite(sr, util_suite()); - srunner_add_suite(sr, cipher_suite()); /* make this a libgaim "ui" */ gaim_check_init(); Modified: trunk/libgaim/tests/tests.h =================================================================== --- trunk/libgaim/tests/tests.h 2006-12-02 19:57:47 UTC (rev 17877) +++ trunk/libgaim/tests/tests.h 2006-12-02 21:12:20 UTC (rev 17878) @@ -6,8 +6,9 @@ /* define the test suites here */ /* remember to add the suite to the runner in check_libgaim.c */ +Suite * cipher_suite(void); +Suite * jabber_jutil_suite(void); Suite * util_suite(void); -Suite * cipher_suite(void); /* helper macros */ #define assert_string_equal(expected, actual) { \ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <the...@us...> - 2006-12-02 19:57:47
|
Revision: 17877 http://svn.sourceforge.net/gaim/?rev=17877&view=rev Author: thekingant Date: 2006-12-02 11:57:47 -0800 (Sat, 02 Dec 2006) Log Message: ----------- Millisecond accuracy for the rolling average thing. It still seems pretty inaccurate. Modified Paths: -------------- trunk/libgaim/protocols/oscar/family_oservice.c trunk/libgaim/protocols/oscar/flap_connection.c trunk/libgaim/protocols/oscar/oscar.h Modified: trunk/libgaim/protocols/oscar/family_oservice.c =================================================================== --- trunk/libgaim/protocols/oscar/family_oservice.c 2006-12-02 10:43:06 UTC (rev 17876) +++ trunk/libgaim/protocols/oscar/family_oservice.c 2006-12-02 19:57:47 UTC (rev 17877) @@ -326,6 +326,8 @@ if (mod->version >= 3) byte_stream_getrawbuf(bs, rateclass->unknown, sizeof(rateclass->unknown)); + rateclass->last.tv_sec = 0; + rateclass->last.tv_usec = 0; conn->rateclasses = g_slist_prepend(conn->rateclasses, rateclass); } conn->rateclasses = g_slist_reverse(conn->rateclasses); Modified: trunk/libgaim/protocols/oscar/flap_connection.c =================================================================== --- trunk/libgaim/protocols/oscar/flap_connection.c 2006-12-02 10:43:06 UTC (rev 17876) +++ trunk/libgaim/protocols/oscar/flap_connection.c 2006-12-02 19:57:47 UTC (rev 17877) @@ -89,18 +89,25 @@ if ((snacpair->group == family) && (snacpair->subtype == subtype)) { /* - * We've found the rateclass for this SNAC family and - * subtype! Update our "current" average by calculating - * a rolling average. This is pretty shoddy. We should - * really keep track of the times when the last last - * windowsize messages that were sent and just calculate - * the REAL average. + * We've found the rateclass for this SNAC family + * and subtype! Update our "current" average by + * calculating a rolling average. This is pretty + * shoddy. We should really keep track of the times + * when the last windowsize messages that were sent + * and just calculate the REAL average. */ - time_t now; - now = time(NULL); + struct timeval now; + struct timezone tz; + unsigned long timediff; /* In milliseconds */ + + gettimeofday(&now, &tz); + timediff = MIN((now.tv_sec - rateclass->last.tv_sec) * 1000 + (now.tv_usec - rateclass->last.tv_usec) / 1000, rateclass->max); + /* This formula is taken from the joscar API docs. */ - rateclass->current = MIN(((rateclass->current * (rateclass->windowsize - 1)) + (now - rateclass->last)) / rateclass->windowsize, rateclass->max); - rateclass->last = now; + rateclass->current = MIN(((rateclass->current * (rateclass->windowsize - 1)) + timediff) / rateclass->windowsize, rateclass->max); + rateclass->last.tv_sec = now.tv_sec; + rateclass->last.tv_usec = now.tv_usec; + return; } } Modified: trunk/libgaim/protocols/oscar/oscar.h =================================================================== --- trunk/libgaim/protocols/oscar/oscar.h 2006-12-02 10:43:06 UTC (rev 17876) +++ trunk/libgaim/protocols/oscar/oscar.h 2006-12-02 19:57:47 UTC (rev 17877) @@ -1578,7 +1578,7 @@ GSList *members; /* Contains node of struct snacpair */ /* TODO: Maybe use a GHashTable for members */ - time_t last; /**< The time when we last sent a SNAC of this rate class. */ + struct timeval last; /**< The time when we last sent a SNAC of this rate class. */ }; int aim_cachecookie(OscarData *od, IcbmCookie *cookie); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <the...@us...> - 2006-12-02 10:43:09
|
Revision: 17876 http://svn.sourceforge.net/gaim/?rev=17876&view=rev Author: thekingant Date: 2006-12-02 02:43:06 -0800 (Sat, 02 Dec 2006) Log Message: ----------- First stab at attempting to keep track of our rate limiting average Modified Paths: -------------- trunk/libgaim/protocols/oscar/family_oservice.c trunk/libgaim/protocols/oscar/flap_connection.c trunk/libgaim/protocols/oscar/oscar.h Modified: trunk/libgaim/protocols/oscar/family_oservice.c =================================================================== --- trunk/libgaim/protocols/oscar/family_oservice.c 2006-12-02 10:17:13 UTC (rev 17875) +++ trunk/libgaim/protocols/oscar/family_oservice.c 2006-12-02 10:43:06 UTC (rev 17876) @@ -266,10 +266,10 @@ rateclass_find(GSList *rateclasses, guint16 id) { GSList *tmp; - struct rateclass *rateclass; for (tmp = rateclasses; tmp != NULL; tmp = tmp->next) { + struct rateclass *rateclass; rateclass = tmp->data; if (rateclass->classid == id) return rateclass; Modified: trunk/libgaim/protocols/oscar/flap_connection.c =================================================================== --- trunk/libgaim/protocols/oscar/flap_connection.c 2006-12-02 10:17:13 UTC (rev 17875) +++ trunk/libgaim/protocols/oscar/flap_connection.c 2006-12-02 10:43:06 UTC (rev 17876) @@ -72,6 +72,42 @@ flap_connection_send(conn, frame); } +static void +update_rate_class(FlapConnection *conn, guint16 family, guint16 subtype) +{ + GSList *tmp1, *tmp2; + + for (tmp1 = conn->rateclasses; tmp1 != NULL; tmp1 = tmp1->next) + { + struct rateclass *rateclass; + rateclass = tmp1->data; + + for (tmp2 = rateclass->members; tmp2 != NULL; tmp2 = tmp2->next) + { + struct snacpair *snacpair; + snacpair = tmp2->data; + if ((snacpair->group == family) && (snacpair->subtype == subtype)) + { + /* + * We've found the rateclass for this SNAC family and + * subtype! Update our "current" average by calculating + * a rolling average. This is pretty shoddy. We should + * really keep track of the times when the last last + * windowsize messages that were sent and just calculate + * the REAL average. + */ + time_t now; + now = time(NULL); + /* This formula is taken from the joscar API docs. */ + rateclass->current = MIN(((rateclass->current * (rateclass->windowsize - 1)) + (now - rateclass->last)) / rateclass->windowsize, rateclass->max); + rateclass->last = now; + return; + } + } + } +} + + /** * This sends a channel 2 FLAP containing a SNAC. The SNAC family and * subtype are looked up in the rate info for this connection, and if @@ -96,6 +132,7 @@ } /* TODO: Outgoing message throttling */ + update_rate_class(conn, family, subtype); flap_connection_send(conn, frame); } Modified: trunk/libgaim/protocols/oscar/oscar.h =================================================================== --- trunk/libgaim/protocols/oscar/oscar.h 2006-12-02 10:17:13 UTC (rev 17875) +++ trunk/libgaim/protocols/oscar/oscar.h 2006-12-02 10:43:06 UTC (rev 17876) @@ -1577,6 +1577,8 @@ guint8 unknown[5]; /* only present in versions >= 3 */ GSList *members; /* Contains node of struct snacpair */ /* TODO: Maybe use a GHashTable for members */ + + time_t last; /**< The time when we last sent a SNAC of this rate class. */ }; int aim_cachecookie(OscarData *od, IcbmCookie *cookie); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <the...@us...> - 2006-12-02 10:17:15
|
Revision: 17875 http://svn.sourceforge.net/gaim/?rev=17875&view=rev Author: thekingant Date: 2006-12-02 02:17:13 -0800 (Sat, 02 Dec 2006) Log Message: ----------- Add a helper function byte_stream_new() that allocates memory for a bytestream in addition to just initializing the data structure. 9 files changed, 56 insertions(+), 91 deletions(-) Modified Paths: -------------- trunk/libgaim/protocols/oscar/bstream.c trunk/libgaim/protocols/oscar/family_icbm.c trunk/libgaim/protocols/oscar/family_locate.c trunk/libgaim/protocols/oscar/flap_connection.c trunk/libgaim/protocols/oscar/odc.c trunk/libgaim/protocols/oscar/oft.c trunk/libgaim/protocols/oscar/oscar.h trunk/libgaim/protocols/oscar/peer_proxy.c trunk/libgaim/protocols/oscar/tlv.c Modified: trunk/libgaim/protocols/oscar/bstream.c =================================================================== --- trunk/libgaim/protocols/oscar/bstream.c 2006-12-02 09:44:53 UTC (rev 17874) +++ trunk/libgaim/protocols/oscar/bstream.c 2006-12-02 10:17:13 UTC (rev 17875) @@ -24,10 +24,18 @@ #include "oscar.h" +int byte_stream_new(ByteStream *bs, guint32 len) +{ + if (bs == NULL) + return -1; + + return byte_stream_init(bs, g_malloc(len), len); +} + int byte_stream_init(ByteStream *bs, guint8 *data, int len) { - if (!bs) + if (bs == NULL) return -1; bs->data = data; Modified: trunk/libgaim/protocols/oscar/family_icbm.c =================================================================== --- trunk/libgaim/protocols/oscar/family_icbm.c 2006-12-02 09:44:53 UTC (rev 17874) +++ trunk/libgaim/protocols/oscar/family_icbm.c 2006-12-02 10:17:13 UTC (rev 17875) @@ -313,7 +313,7 @@ msgtlvlen += 4 /* charset */ + args->msglen; } - byte_stream_init(&data, g_malloc(msgtlvlen + 128), msgtlvlen + 128); + byte_stream_new(&data, msgtlvlen + 128); /* Generate an ICBM cookie */ aim_icbm_makecookie(cookie); @@ -452,8 +452,6 @@ struct aim_invite_priv *priv; guchar cookie[8]; aim_tlvlist_t *otl = NULL, *itl = NULL; - guint8 *hdr; - int hdrlen; ByteStream hdrbs; if (!od || !(conn = flap_connection_findbygroup(od, 0x0004))) @@ -494,9 +492,7 @@ * raw data, followed by a series of TLVs. * */ - hdrlen = 2+8+16+6+4+4+strlen(msg)+4+2+1+strlen(roomname)+2; - hdr = malloc(hdrlen); - byte_stream_init(&hdrbs, hdr, hdrlen); + byte_stream_new(&hdrbs, 2+8+16+6+4+4+strlen(msg)+4+2+1+strlen(roomname)+2); byte_stream_put16(&hdrbs, 0x0000); /* Unknown! */ byte_stream_putraw(&hdrbs, cookie, sizeof(cookie)); /* I think... */ @@ -508,11 +504,11 @@ aim_tlvlist_add_chatroom(&itl, 0x2711, exchange, roomname, instance); aim_tlvlist_write(&hdrbs, &itl); - aim_tlvlist_add_raw(&otl, 0x0005, byte_stream_curpos(&hdrbs), hdr); + aim_tlvlist_add_raw(&otl, 0x0005, byte_stream_curpos(&hdrbs), hdrbs.data); + g_free(hdrbs.data); aim_tlvlist_write(&frame->data, &otl); - free(hdr); aim_tlvlist_free(&itl); aim_tlvlist_free(&otl); @@ -694,8 +690,6 @@ FlapFrame *frame; aim_snacid_t snacid; aim_tlvlist_t *tl = NULL, *itl = NULL; - int hdrlen; - guint8 *hdr; ByteStream hdrbs; od = peer_conn->od; @@ -713,9 +707,7 @@ aim_tlvlist_add_noval(&tl, 0x0003); - hdrlen = 64; - hdr = malloc(hdrlen); - byte_stream_init(&hdrbs, hdr, hdrlen); + byte_stream_new(&hdrbs, 64); byte_stream_put16(&hdrbs, AIM_RENDEZVOUS_CANCEL); byte_stream_putraw(&hdrbs, peer_conn->cookie, 8); @@ -725,11 +717,11 @@ aim_tlvlist_add_16(&itl, 0x000b, 0x0001); aim_tlvlist_write(&hdrbs, &itl); - aim_tlvlist_add_raw(&tl, 0x0005, byte_stream_curpos(&hdrbs), hdr); + aim_tlvlist_add_raw(&tl, 0x0005, byte_stream_curpos(&hdrbs), hdrbs.data); + g_free(hdrbs.data); aim_tlvlist_write(&frame->data, &tl); - free(hdr); aim_tlvlist_free(&itl); aim_tlvlist_free(&tl); @@ -784,8 +776,6 @@ FlapFrame *frame; aim_snacid_t snacid; aim_tlvlist_t *tl = NULL, *itl = NULL; - int hdrlen; - guint8 *hdr; ByteStream hdrbs; conn = flap_connection_findbygroup(od, 0x0004); @@ -802,9 +792,7 @@ aim_tlvlist_add_noval(&tl, 0x0003); - hdrlen = 128; - hdr = malloc(hdrlen); - byte_stream_init(&hdrbs, hdr, hdrlen); + byte_stream_new(&hdrbs, 128); byte_stream_put16(&hdrbs, AIM_RENDEZVOUS_PROPOSE); byte_stream_putraw(&hdrbs, cookie, 8); @@ -817,11 +805,11 @@ aim_tlvlist_add_noval(&itl, 0x000f); aim_tlvlist_write(&hdrbs, &itl); - aim_tlvlist_add_raw(&tl, 0x0005, byte_stream_curpos(&hdrbs), hdr); + aim_tlvlist_add_raw(&tl, 0x0005, byte_stream_curpos(&hdrbs), hdrbs.data); + g_free(hdrbs.data); aim_tlvlist_write(&frame->data, &tl); - free(hdr); aim_tlvlist_free(&itl); aim_tlvlist_free(&tl); @@ -839,8 +827,6 @@ FlapFrame *frame; aim_snacid_t snacid; aim_tlvlist_t *tl = NULL, *itl = NULL; - int hdrlen; - guint8 *hdr; ByteStream hdrbs; guint8 ip_comp[4]; @@ -858,9 +844,7 @@ aim_tlvlist_add_noval(&tl, 0x0003); - hdrlen = 128; - hdr = malloc(hdrlen); - byte_stream_init(&hdrbs, hdr, hdrlen); + byte_stream_new(&hdrbs, 128); byte_stream_put16(&hdrbs, AIM_RENDEZVOUS_PROPOSE); byte_stream_putraw(&hdrbs, cookie, 8); @@ -883,11 +867,11 @@ aim_tlvlist_write(&hdrbs, &itl); - aim_tlvlist_add_raw(&tl, 0x0005, byte_stream_curpos(&hdrbs), hdr); + aim_tlvlist_add_raw(&tl, 0x0005, byte_stream_curpos(&hdrbs), hdrbs.data); + g_free(hdrbs.data); aim_tlvlist_write(&frame->data, &tl); - free(hdr); aim_tlvlist_free(&itl); aim_tlvlist_free(&tl); @@ -905,8 +889,6 @@ FlapFrame *frame; aim_snacid_t snacid; aim_tlvlist_t *tl = NULL, *itl = NULL; - int hdrlen, buflen; - guint8 *hdr; ByteStream hdrbs; conn = flap_connection_findbygroup(od, 0x0004); @@ -923,9 +905,7 @@ aim_tlvlist_add_noval(&tl, 0x0003); - hdrlen = 512; - hdr = malloc(hdrlen); - byte_stream_init(&hdrbs, hdr, hdrlen); + byte_stream_new(&hdrbs, 512); byte_stream_put16(&hdrbs, AIM_RENDEZVOUS_PROPOSE); byte_stream_putraw(&hdrbs, cookie, 8); @@ -954,8 +934,7 @@ ByteStream bs; /* Begin TLV t(2711) */ - buflen = 2+2+4+strlen(filename)+1; - byte_stream_init(&bs, malloc(buflen), buflen); + byte_stream_new(&bs, 2+2+4+strlen(filename)+1); byte_stream_put16(&bs, (numfiles > 1) ? 0x0002 : 0x0001); byte_stream_put16(&bs, numfiles); byte_stream_put32(&bs, size); @@ -965,16 +944,16 @@ byte_stream_put8(&bs, 0x00); aim_tlvlist_add_raw(&itl, 0x2711, bs.len, bs.data); - free(bs.data); + g_free(bs.data); /* End TLV t(2711) */ } aim_tlvlist_write(&hdrbs, &itl); - aim_tlvlist_add_raw(&tl, 0x0005, byte_stream_curpos(&hdrbs), hdr); + aim_tlvlist_add_raw(&tl, 0x0005, byte_stream_curpos(&hdrbs), hdrbs.data); + g_free(hdrbs.data); aim_tlvlist_write(&frame->data, &tl); - free(hdr); aim_tlvlist_free(&itl); aim_tlvlist_free(&tl); @@ -992,8 +971,6 @@ FlapFrame *frame; aim_snacid_t snacid; aim_tlvlist_t *tl = NULL, *itl = NULL; - int hdrlen, buflen; - guint8 *hdr; ByteStream hdrbs; guint8 ip_comp[4]; @@ -1011,9 +988,7 @@ aim_tlvlist_add_noval(&tl, 0x0003); - hdrlen = 512; - hdr = malloc(hdrlen); - byte_stream_init(&hdrbs, hdr, hdrlen); + byte_stream_new(&hdrbs, 512); byte_stream_put16(&hdrbs, AIM_RENDEZVOUS_PROPOSE); byte_stream_putraw(&hdrbs, cookie, 8); @@ -1050,8 +1025,7 @@ ByteStream bs; /* Begin TLV t(2711) */ - buflen = 2+2+4+strlen(filename)+1; - byte_stream_init(&bs, malloc(buflen), buflen); + byte_stream_new(&bs, 2+2+4+strlen(filename)+1); byte_stream_put16(&bs, (numfiles > 1) ? 0x0002 : 0x0001); byte_stream_put16(&bs, numfiles); byte_stream_put32(&bs, size); @@ -1061,17 +1035,17 @@ byte_stream_put8(&bs, 0x00); aim_tlvlist_add_raw(&itl, 0x2711, bs.len, bs.data); - free(bs.data); + g_free(bs.data); /* End TLV t(2711) */ } aim_tlvlist_write(&hdrbs, &itl); - aim_tlvlist_add_raw(&tl, 0x0005, byte_stream_curpos(&hdrbs), hdr); + aim_tlvlist_add_raw(&tl, 0x0005, byte_stream_curpos(&hdrbs), hdrbs.data); + g_free(hdrbs.data); aim_tlvlist_write(&frame->data, &tl); - free(hdr); aim_tlvlist_free(&itl); aim_tlvlist_free(&tl); Modified: trunk/libgaim/protocols/oscar/family_locate.c =================================================================== --- trunk/libgaim/protocols/oscar/family_locate.c 2006-12-02 09:44:53 UTC (rev 17874) +++ trunk/libgaim/protocols/oscar/family_locate.c 2006-12-02 10:17:13 UTC (rev 17875) @@ -1356,15 +1356,13 @@ aim_locate_getinfoshort(OscarData *od, const char *sn, guint32 flags) { FlapConnection *conn; - unsigned int length; ByteStream data; aim_snacid_t snacid; if (!od || !(conn = flap_connection_findbygroup(od, SNAC_FAMILY_LOCATE)) || !sn) return -EINVAL; - length = 4 + 1 + strlen(sn); - byte_stream_init(&data, g_malloc(length), length); + byte_stream_new(&data, 4 + 1 + strlen(sn)); byte_stream_put32(&data, flags); byte_stream_put8(&data, strlen(sn)); byte_stream_putstr(&data, sn); Modified: trunk/libgaim/protocols/oscar/flap_connection.c =================================================================== --- trunk/libgaim/protocols/oscar/flap_connection.c 2006-12-02 09:44:53 UTC (rev 17874) +++ trunk/libgaim/protocols/oscar/flap_connection.c 2006-12-02 10:17:13 UTC (rev 17875) @@ -480,11 +480,7 @@ frame->channel = channel; if (datalen > 0) - { - guint8 *data; - data = g_malloc(datalen); - byte_stream_init(&frame->data, data, datalen); - } + byte_stream_new(&frame->data, datalen); return frame; } @@ -819,7 +815,7 @@ payloadlen = byte_stream_curpos(&frame->data); - byte_stream_init(&bs, malloc(6 + payloadlen), 6 + payloadlen); + byte_stream_new(&bs, 6 + payloadlen); /* FLAP header */ byte_stream_put8(&bs, 0x2a); @@ -835,7 +831,7 @@ byte_stream_rewind(&bs); flap_connection_send_byte_stream(&bs, conn, bslen); - free(bs.data); /* XXX byte_stream_free */ + g_free(bs.data); /* XXX byte_stream_free */ } void Modified: trunk/libgaim/protocols/oscar/odc.c =================================================================== --- trunk/libgaim/protocols/oscar/odc.c 2006-12-02 09:44:53 UTC (rev 17874) +++ trunk/libgaim/protocols/oscar/odc.c 2006-12-02 10:17:13 UTC (rev 17875) @@ -96,8 +96,7 @@ memcpy(frame->cookie, conn->cookie, 8); length = 76; - byte_stream_init(&bs, malloc(length + frame->payload.len), - length + frame->payload.len); + byte_stream_new(&bs, length + frame->payload.len); byte_stream_putraw(&bs, conn->magic, 4); byte_stream_put16(&bs, length); byte_stream_put16(&bs, frame->type); @@ -120,7 +119,7 @@ peer_connection_send(conn, &bs); - free(bs.data); + g_free(bs.data); } /** @@ -188,7 +187,7 @@ frame.payload.len = len; frame.encoding = encoding; frame.flags = autoreply; - byte_stream_init(&frame.payload, malloc(len), len); + byte_stream_new(&frame.payload, len); byte_stream_putraw(&frame.payload, (guint8 *)msg, len); peer_odc_send(conn, &frame); Modified: trunk/libgaim/protocols/oscar/oft.c =================================================================== --- trunk/libgaim/protocols/oscar/oft.c 2006-12-02 09:44:53 UTC (rev 17874) +++ trunk/libgaim/protocols/oscar/oft.c 2006-12-02 10:17:13 UTC (rev 17875) @@ -160,7 +160,7 @@ ByteStream bs; length = 192 + MAX(64, frame->name_length + 1); - byte_stream_init(&bs, malloc(length), length); + byte_stream_new(&bs, length); byte_stream_putraw(&bs, conn->magic, 4); byte_stream_put16(&bs, length); byte_stream_put16(&bs, frame->type); @@ -197,7 +197,7 @@ peer_connection_send(conn, &bs); - free(bs.data); + g_free(bs.data); } void Modified: trunk/libgaim/protocols/oscar/oscar.h =================================================================== --- trunk/libgaim/protocols/oscar/oscar.h 2006-12-02 09:44:53 UTC (rev 17874) +++ trunk/libgaim/protocols/oscar/oscar.h 2006-12-02 10:17:13 UTC (rev 17875) @@ -1504,6 +1504,7 @@ void aim_genericreq_s(OscarData *od, FlapConnection *conn, guint16 family, guint16 subtype, guint16 *); /* bstream.c */ +int byte_stream_new(ByteStream *bs, guint32 len); int byte_stream_init(ByteStream *bs, guint8 *data, int len); int byte_stream_empty(ByteStream *bs); int byte_stream_curpos(ByteStream *bs); Modified: trunk/libgaim/protocols/oscar/peer_proxy.c =================================================================== --- trunk/libgaim/protocols/oscar/peer_proxy.c 2006-12-02 09:44:53 UTC (rev 17874) +++ trunk/libgaim/protocols/oscar/peer_proxy.c 2006-12-02 10:17:13 UTC (rev 17875) @@ -38,7 +38,7 @@ frame->flags, frame->payload.len); length = 12 + frame->payload.len; - byte_stream_init(&bs, malloc(length), length); + byte_stream_new(&bs, length); byte_stream_put16(&bs, length - 2); byte_stream_put16(&bs, PEER_PROXY_PACKET_VERSION); byte_stream_put16(&bs, frame->type); @@ -48,7 +48,7 @@ peer_connection_send(conn, &bs); - free(bs.data); + g_free(bs.data); } /** @@ -65,7 +65,6 @@ GaimAccount *account; const gchar *sn; guint8 sn_length; - size_t length; memset(&frame, 0, sizeof(ProxyFrame)); frame.type = PEER_PROXY_TYPE_CREATE; @@ -74,8 +73,7 @@ account = gaim_connection_get_account(conn->od->gc); sn = gaim_account_get_username(account); sn_length = strlen(sn); - length = 1 + sn_length + 8 + 20; - byte_stream_init(&frame.payload, malloc(length), length); + byte_stream_new(&frame.payload, 1 + sn_length + 8 + 20); byte_stream_put8(&frame.payload, sn_length); byte_stream_putraw(&frame.payload, (const guint8 *)sn, sn_length); byte_stream_putraw(&frame.payload, conn->cookie, 8); @@ -103,7 +101,6 @@ GaimAccount *account; const gchar *sn; guint8 sn_length; - size_t length; memset(&frame, 0, sizeof(ProxyFrame)); frame.type = PEER_PROXY_TYPE_JOIN; @@ -112,8 +109,7 @@ account = gaim_connection_get_account(conn->od->gc); sn = gaim_account_get_username(account); sn_length = strlen(sn); - length = 1 + sn_length + 2 + 8 + 20; - byte_stream_init(&frame.payload, malloc(length), length); + byte_stream_new(&frame.payload, 1 + sn_length + 2 + 8 + 20); byte_stream_put8(&frame.payload, sn_length); byte_stream_putraw(&frame.payload, (const guint8 *)sn, sn_length); byte_stream_put16(&frame.payload, pin); Modified: trunk/libgaim/protocols/oscar/tlv.c =================================================================== --- trunk/libgaim/protocols/oscar/tlv.c 2006-12-02 09:44:53 UTC (rev 17874) +++ trunk/libgaim/protocols/oscar/tlv.c 2006-12-02 10:17:13 UTC (rev 17875) @@ -264,8 +264,8 @@ if (aim_tlvlist_size(&one) != aim_tlvlist_size(&two)) return 1; - byte_stream_init(&bs1, ((guint8 *)malloc(aim_tlvlist_size(&one)*sizeof(guint8))), aim_tlvlist_size(&one)); - byte_stream_init(&bs2, ((guint8 *)malloc(aim_tlvlist_size(&two)*sizeof(guint8))), aim_tlvlist_size(&two)); + byte_stream_new(&bs1, aim_tlvlist_size(&one)); + byte_stream_new(&bs2, aim_tlvlist_size(&two)); aim_tlvlist_write(&bs1, &one); aim_tlvlist_write(&bs2, &two); @@ -276,8 +276,8 @@ return 1; } - free(bs1.data); - free(bs2.data); + g_free(bs1.data); + g_free(bs2.data); return 0; } @@ -512,23 +512,19 @@ */ int aim_tlvlist_add_chatroom(aim_tlvlist_t **list, guint16 type, guint16 exchange, const char *roomname, guint16 instance) { - guint8 *buf; int len; ByteStream bs; - len = 2 + 1 + strlen(roomname) + 2; + byte_stream_new(&bs, 2 + 1 + strlen(roomname) + 2); - buf = malloc(len); - byte_stream_init(&bs, buf, len); - byte_stream_put16(&bs, exchange); byte_stream_put8(&bs, strlen(roomname)); byte_stream_putstr(&bs, roomname); byte_stream_put16(&bs, instance); - len = aim_tlvlist_add_raw(list, type, byte_stream_curpos(&bs), buf); + len = aim_tlvlist_add_raw(list, type, byte_stream_curpos(&bs), bs.data); - free(buf); + g_free(bs.data); return len; } @@ -563,7 +559,6 @@ */ int aim_tlvlist_add_frozentlvlist(aim_tlvlist_t **list, guint16 type, aim_tlvlist_t **tl) { - guint8 *buf; int buflen; ByteStream bs; @@ -572,15 +567,13 @@ if (buflen <= 0) return 0; - buf = malloc(buflen); + byte_stream_new(&bs, buflen); - byte_stream_init(&bs, buf, buflen); - aim_tlvlist_write(&bs, tl); - aim_tlvlist_add_raw(list, type, byte_stream_curpos(&bs), buf); + aim_tlvlist_add_raw(list, type, byte_stream_curpos(&bs), bs.data); - free(buf); + g_free(bs.data); return buflen; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <the...@us...> - 2006-12-02 09:51:20
|
Revision: 17874 http://svn.sourceforge.net/gaim/?rev=17874&view=rev Author: thekingant Date: 2006-12-02 01:44:53 -0800 (Sat, 02 Dec 2006) Log Message: ----------- Add a flap_connection_send_snac() helper function that makes it a little easier/cleaner to send a SNAC-based FLAP command. Modified Paths: -------------- trunk/libgaim/protocols/oscar/family_icbm.c trunk/libgaim/protocols/oscar/family_locate.c trunk/libgaim/protocols/oscar/flap_connection.c trunk/libgaim/protocols/oscar/oscar.h Modified: trunk/libgaim/protocols/oscar/family_icbm.c =================================================================== --- trunk/libgaim/protocols/oscar/family_icbm.c 2006-12-02 08:56:35 UTC (rev 17873) +++ trunk/libgaim/protocols/oscar/family_icbm.c 2006-12-02 09:44:53 UTC (rev 17874) @@ -269,8 +269,8 @@ int aim_im_sendch1_ext(OscarData *od, struct aim_sendimext_args *args) { FlapConnection *conn; - FlapFrame *frame; aim_snacid_t snacid; + ByteStream data; guchar cookie[8]; int msgtlvlen; static const guint8 deffeatures[] = { 0x01, 0x01, 0x01, 0x02 }; @@ -313,30 +313,26 @@ msgtlvlen += 4 /* charset */ + args->msglen; } - frame = flap_frame_new(od, 0x02, msgtlvlen+128); + byte_stream_init(&data, g_malloc(msgtlvlen + 128), msgtlvlen + 128); - /* XXX - should be optional */ - snacid = aim_cachesnac(od, 0x0004, 0x0006, 0x0000, args->destsn, strlen(args->destsn)+1); - aim_putsnac(&frame->data, 0x0004, 0x0006, 0x0000, snacid); - /* Generate an ICBM cookie */ aim_icbm_makecookie(cookie); /* ICBM header */ - aim_im_puticbm(&frame->data, cookie, 0x0001, args->destsn); + aim_im_puticbm(&data, cookie, 0x0001, args->destsn); /* Message TLV (type 0x0002) */ - byte_stream_put16(&frame->data, 0x0002); - byte_stream_put16(&frame->data, msgtlvlen); + byte_stream_put16(&data, 0x0002); + byte_stream_put16(&data, msgtlvlen); /* Features TLV (type 0x0501) */ - byte_stream_put16(&frame->data, 0x0501); + byte_stream_put16(&data, 0x0501); if (args->flags & AIM_IMFLAGS_CUSTOMFEATURES) { - byte_stream_put16(&frame->data, args->featureslen); - byte_stream_putraw(&frame->data, args->features, args->featureslen); + byte_stream_put16(&data, args->featureslen); + byte_stream_putraw(&data, args->features, args->featureslen); } else { - byte_stream_put16(&frame->data, sizeof(deffeatures)); - byte_stream_putraw(&frame->data, deffeatures, sizeof(deffeatures)); + byte_stream_put16(&data, sizeof(deffeatures)); + byte_stream_putraw(&data, deffeatures, sizeof(deffeatures)); } if (args->flags & AIM_IMFLAGS_MULTIPART) { @@ -344,42 +340,42 @@ /* Insert each message part in a TLV (type 0x0101) */ for (sec = args->mpmsg->parts; sec; sec = sec->next) { - byte_stream_put16(&frame->data, 0x0101); - byte_stream_put16(&frame->data, sec->datalen + 4); - byte_stream_put16(&frame->data, sec->charset); - byte_stream_put16(&frame->data, sec->charsubset); - byte_stream_putraw(&frame->data, (guchar *)sec->data, sec->datalen); + byte_stream_put16(&data, 0x0101); + byte_stream_put16(&data, sec->datalen + 4); + byte_stream_put16(&data, sec->charset); + byte_stream_put16(&data, sec->charsubset); + byte_stream_putraw(&data, (guchar *)sec->data, sec->datalen); } } else { /* Insert message text in a TLV (type 0x0101) */ - byte_stream_put16(&frame->data, 0x0101); + byte_stream_put16(&data, 0x0101); /* Message block length */ - byte_stream_put16(&frame->data, args->msglen + 0x04); + byte_stream_put16(&data, args->msglen + 0x04); /* Character set */ - byte_stream_put16(&frame->data, args->charset); - byte_stream_put16(&frame->data, args->charsubset); + byte_stream_put16(&data, args->charset); + byte_stream_put16(&data, args->charsubset); /* Message. Not terminated */ - byte_stream_putraw(&frame->data, (guchar *)args->msg, args->msglen); + byte_stream_putraw(&data, (guchar *)args->msg, args->msglen); } /* Set the Autoresponse flag */ if (args->flags & AIM_IMFLAGS_AWAY) { - byte_stream_put16(&frame->data, 0x0004); - byte_stream_put16(&frame->data, 0x0000); + byte_stream_put16(&data, 0x0004); + byte_stream_put16(&data, 0x0000); } else if (args->flags & AIM_IMFLAGS_ACK) { /* Set the Request Acknowledge flag */ - byte_stream_put16(&frame->data, 0x0003); - byte_stream_put16(&frame->data, 0x0000); + byte_stream_put16(&data, 0x0003); + byte_stream_put16(&data, 0x0000); } if (args->flags & AIM_IMFLAGS_OFFLINE) { - byte_stream_put16(&frame->data, 0x0006); - byte_stream_put16(&frame->data, 0x0000); + byte_stream_put16(&data, 0x0006); + byte_stream_put16(&data, 0x0000); } /* @@ -388,12 +384,12 @@ * IMs and when you change your icon. */ if (args->flags & AIM_IMFLAGS_HASICON) { - byte_stream_put16(&frame->data, 0x0008); - byte_stream_put16(&frame->data, 0x000c); - byte_stream_put32(&frame->data, args->iconlen); - byte_stream_put16(&frame->data, 0x0001); - byte_stream_put16(&frame->data, args->iconsum); - byte_stream_put32(&frame->data, args->iconstamp); + byte_stream_put16(&data, 0x0008); + byte_stream_put16(&data, 0x000c); + byte_stream_put32(&data, args->iconlen); + byte_stream_put16(&data, 0x0001); + byte_stream_put16(&data, args->iconsum); + byte_stream_put32(&data, args->iconstamp); } /* @@ -401,12 +397,16 @@ * XXX - Every time? Surely not... */ if (args->flags & AIM_IMFLAGS_BUDDYREQ) { - byte_stream_put16(&frame->data, 0x0009); - byte_stream_put16(&frame->data, 0x0000); + byte_stream_put16(&data, 0x0009); + byte_stream_put16(&data, 0x0000); } - flap_connection_send(conn, frame); + /* XXX - should be optional */ + snacid = aim_cachesnac(od, 0x0004, 0x0006, 0x0000, args->destsn, strlen(args->destsn)+1); + flap_connection_send_snac(od, conn, 0x0004, 0x0006, 0x0000, snacid, &data); + g_free(data.data); + /* clean out SNACs over 60sec old */ aim_cleansnacs(od, 60); Modified: trunk/libgaim/protocols/oscar/family_locate.c =================================================================== --- trunk/libgaim/protocols/oscar/family_locate.c 2006-12-02 08:56:35 UTC (rev 17873) +++ trunk/libgaim/protocols/oscar/family_locate.c 2006-12-02 09:44:53 UTC (rev 17874) @@ -1356,23 +1356,24 @@ aim_locate_getinfoshort(OscarData *od, const char *sn, guint32 flags) { FlapConnection *conn; - FlapFrame *frame; + unsigned int length; + ByteStream data; aim_snacid_t snacid; if (!od || !(conn = flap_connection_findbygroup(od, SNAC_FAMILY_LOCATE)) || !sn) return -EINVAL; - frame = flap_frame_new(od, 0x02, 10+4+1+strlen(sn)); + length = 4 + 1 + strlen(sn); + byte_stream_init(&data, g_malloc(length), length); + byte_stream_put32(&data, flags); + byte_stream_put8(&data, strlen(sn)); + byte_stream_putstr(&data, sn); snacid = aim_cachesnac(od, 0x0002, 0x0015, 0x0000, sn, strlen(sn)+1); + flap_connection_send_snac(od, conn, 0x0002, 0x0015, 0x0000, snacid, &data); - aim_putsnac(&frame->data, 0x0002, 0x0015, 0x0000, snacid); - byte_stream_put32(&frame->data, flags); - byte_stream_put8(&frame->data, strlen(sn)); - byte_stream_putstr(&frame->data, sn); + g_free(data.data); - flap_connection_send(conn, frame); - return 0; } Modified: trunk/libgaim/protocols/oscar/flap_connection.c =================================================================== --- trunk/libgaim/protocols/oscar/flap_connection.c 2006-12-02 08:56:35 UTC (rev 17873) +++ trunk/libgaim/protocols/oscar/flap_connection.c 2006-12-02 09:44:53 UTC (rev 17874) @@ -51,7 +51,7 @@ } /** - * This sends a channel 1 SNAC containing the FLAP version and + * This sends a channel 1 FLAP containing the FLAP version and * the authentication cookie. This is sent when connecting to * any FLAP server after the initial connection to the auth * server. It is always the very first packet sent by both the @@ -73,7 +73,35 @@ } /** - * This sends an empty channel 4 SNAC. This is sent to signify + * This sends a channel 2 FLAP containing a SNAC. The SNAC family and + * subtype are looked up in the rate info for this connection, and if + * sending this SNAC will induce rate limiting then we delay sending + * of the SNAC by putting it into an outgoing holding queue. + */ +void +flap_connection_send_snac(OscarData *od, FlapConnection *conn, guint16 family, guint16 subtype, guint16 flags, aim_snacid_t snacid, ByteStream *data) +{ + FlapFrame *frame; + guint32 length; + + length = data != NULL ? data->offset : 0; + + frame = flap_frame_new(od, 0x02, 10 + length); + aim_putsnac(&frame->data, family, subtype, flags, snacid); + + if (length > 0) + { + byte_stream_rewind(data); + byte_stream_putbs(&frame->data, data, length); + } + + /* TODO: Outgoing message throttling */ + + flap_connection_send(conn, frame); +} + +/** + * This sends an empty channel 4 FLAP. This is sent to signify * that we're logging off. This shouldn't really be necessary-- * usually the AIM server will detect that the TCP connection has * been destroyed--but it's good practice. @@ -88,7 +116,7 @@ } /** - * This sends an empty channel 5 SNAC. This is used as a keepalive + * This sends an empty channel 5 FLAP. This is used as a keepalive * packet in FLAP connections. WinAIM 4.x and higher send these * _every minute_ to keep the connection alive. */ Modified: trunk/libgaim/protocols/oscar/oscar.h =================================================================== --- trunk/libgaim/protocols/oscar/oscar.h 2006-12-02 08:56:35 UTC (rev 17873) +++ trunk/libgaim/protocols/oscar/oscar.h 2006-12-02 09:44:53 UTC (rev 17874) @@ -582,6 +582,7 @@ void flap_connection_send(FlapConnection *conn, FlapFrame *frame); void flap_connection_send_version(OscarData *od, FlapConnection *conn); void flap_connection_send_version_with_cookie(OscarData *od, FlapConnection *conn, guint16 length, const guint8 *chipsahoy); +void flap_connection_send_snac(OscarData *od, FlapConnection *conn, guint16 family, const guint16 subtype, guint16 flags, aim_snacid_t snacid, ByteStream *data); void flap_connection_send_keepalive(OscarData *od, FlapConnection *conn); FlapFrame *flap_frame_new(OscarData *od, guint16 channel, int datalen); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <the...@us...> - 2006-12-02 09:01:36
|
Revision: 17873 http://svn.sourceforge.net/gaim/?rev=17873&view=rev Author: thekingant Date: 2006-12-02 00:56:35 -0800 (Sat, 02 Dec 2006) Log Message: ----------- Update our current rate information stuff when the server slaps us on the wrist for sending SNACs too rapidly Modified Paths: -------------- trunk/libgaim/protocols/oscar/family_oservice.c Modified: trunk/libgaim/protocols/oscar/family_oservice.c =================================================================== --- trunk/libgaim/protocols/oscar/family_oservice.c 2006-12-02 08:37:24 UTC (rev 17872) +++ trunk/libgaim/protocols/oscar/family_oservice.c 2006-12-02 08:56:35 UTC (rev 17873) @@ -430,22 +430,27 @@ { int ret = 0; aim_rxcallback_t userfunc; - guint16 code, rateclass; - guint32 currentavg, maxavg, windowsize, clear, alert, limit, disconnect; + guint16 code, classid; + struct rateclass *rateclass; code = byte_stream_get16(bs); - rateclass = byte_stream_get16(bs); + classid = byte_stream_get16(bs); - windowsize = byte_stream_get32(bs); - clear = byte_stream_get32(bs); - alert = byte_stream_get32(bs); - limit = byte_stream_get32(bs); - disconnect = byte_stream_get32(bs); - currentavg = byte_stream_get32(bs); - maxavg = byte_stream_get32(bs); + rateclass = rateclass_find(conn->rateclasses, classid); + if (rateclass == NULL) + /* This should never really happen */ + return 0; + rateclass->windowsize = byte_stream_get32(bs); + rateclass->clear = byte_stream_get32(bs); + rateclass->alert = byte_stream_get32(bs); + rateclass->limit = byte_stream_get32(bs); + rateclass->disconnect = byte_stream_get32(bs); + rateclass->current = byte_stream_get32(bs); + rateclass->max = byte_stream_get32(bs); + if ((userfunc = aim_callhandler(od, snac->family, snac->subtype))) - ret = userfunc(od, conn, frame, code, rateclass, windowsize, clear, alert, limit, disconnect, currentavg, maxavg); + ret = userfunc(od, conn, frame, code, classid, rateclass->windowsize, rateclass->clear, rateclass->alert, rateclass->limit, rateclass->disconnect, rateclass->current, rateclass->max); return ret; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <the...@us...> - 2006-12-02 08:41:16
|
Revision: 17872 http://svn.sourceforge.net/gaim/?rev=17872&view=rev Author: thekingant Date: 2006-12-02 00:37:24 -0800 (Sat, 02 Dec 2006) Log Message: ----------- Use GSLists in two places instead of self-made linked lists. I find this to be much more readable. 3 files changed, 67 insertions(+), 88 deletions(-) Modified Paths: -------------- trunk/libgaim/protocols/oscar/family_oservice.c trunk/libgaim/protocols/oscar/flap_connection.c trunk/libgaim/protocols/oscar/oscar.h Modified: trunk/libgaim/protocols/oscar/family_oservice.c =================================================================== --- trunk/libgaim/protocols/oscar/family_oservice.c 2006-12-02 08:03:45 UTC (rev 17871) +++ trunk/libgaim/protocols/oscar/family_oservice.c 2006-12-02 08:37:24 UTC (rev 17872) @@ -262,57 +262,32 @@ * http://dscoder.com/RateClassInfo.html */ -static void -rc_addclass(struct rateclass **head, struct rateclass *inrc) -{ - struct rateclass *rc, *rc2; - - rc = g_memdup(inrc, sizeof(struct rateclass)); - rc->next = NULL; - - for (rc2 = *head; rc2 && rc2->next; rc2 = rc2->next) - ; - - if (!rc2) - *head = rc; - else - rc2->next = rc; - - return; -} - static struct rateclass * -rc_findclass(struct rateclass **head, guint16 id) +rateclass_find(GSList *rateclasses, guint16 id) { - struct rateclass *rc; + GSList *tmp; + struct rateclass *rateclass; - for (rc = *head; rc; rc = rc->next) { - if (rc->classid == id) - return rc; + for (tmp = rateclasses; tmp != NULL; tmp = tmp->next) + { + rateclass = tmp->data; + if (rateclass->classid == id) + return rateclass; } return NULL; } static void -rc_addpair(struct rateclass *rc, guint16 group, guint16 type) +rateclass_addpair(struct rateclass *rateclass, guint16 group, guint16 type) { - struct snacpair *sp, *sp2; + struct snacpair *snacpair; - sp = g_new0(struct snacpair, 1); - sp->group = group; - sp->subtype = type; - sp->next = NULL; + snacpair = g_new(struct snacpair, 1); + snacpair->group = group; + snacpair->subtype = type; - for (sp2 = rc->members; sp2 && sp2->next; sp2 = sp2->next) - ; - - if (!sp2) - rc->members = sp; - else - sp2->next = sp; - - return; + rateclass->members = g_slist_prepend(rateclass->members, snacpair); } /* Subtype 0x0007 - Rate Parameters */ @@ -326,19 +301,20 @@ * First are the parameters for each rate class. */ numclasses = byte_stream_get16(bs); - for (i = 0; i < numclasses; i++) { - struct rateclass rc; + for (i = 0; i < numclasses; i++) + { + struct rateclass *rateclass; - memset(&rc, 0, sizeof(struct rateclass)); + rateclass = g_new0(struct rateclass, 1); - rc.classid = byte_stream_get16(bs); - rc.windowsize = byte_stream_get32(bs); - rc.clear = byte_stream_get32(bs); - rc.alert = byte_stream_get32(bs); - rc.limit = byte_stream_get32(bs); - rc.disconnect = byte_stream_get32(bs); - rc.current = byte_stream_get32(bs); - rc.max = byte_stream_get32(bs); + rateclass->classid = byte_stream_get16(bs); + rateclass->windowsize = byte_stream_get32(bs); + rateclass->clear = byte_stream_get32(bs); + rateclass->alert = byte_stream_get32(bs); + rateclass->limit = byte_stream_get32(bs); + rateclass->disconnect = byte_stream_get32(bs); + rateclass->current = byte_stream_get32(bs); + rateclass->max = byte_stream_get32(bs); /* * The server will send an extra five bytes of parameters @@ -348,39 +324,43 @@ * the new version hardcoded here. */ if (mod->version >= 3) - byte_stream_getrawbuf(bs, rc.unknown, sizeof(rc.unknown)); + byte_stream_getrawbuf(bs, rateclass->unknown, sizeof(rateclass->unknown)); - rc_addclass(&conn->rates, &rc); + conn->rateclasses = g_slist_prepend(conn->rateclasses, rateclass); } + conn->rateclasses = g_slist_reverse(conn->rateclasses); /* * Then the members of each class. */ - for (i = 0; i < numclasses; i++) { + for (i = 0; i < numclasses; i++) + { guint16 classid, count; - struct rateclass *rc; + struct rateclass *rateclass; int j; classid = byte_stream_get16(bs); count = byte_stream_get16(bs); - rc = rc_findclass(&conn->rates, classid); + rateclass = rateclass_find(conn->rateclasses, classid); - for (j = 0; j < count; j++) { + for (j = 0; j < count; j++) + { guint16 group, subtype; group = byte_stream_get16(bs); subtype = byte_stream_get16(bs); - if (rc) - rc_addpair(rc, group, subtype); + if (rateclass != NULL) + rateclass_addpair(rateclass, group, subtype); } + rateclass->members = g_slist_reverse(rateclass->members); } /* * We don't pass the rate information up to the client, as it really * doesn't care. The information is stored in the connection, however - * so that we can do more fun stuff later (not really). + * so that we can do rate limiting management when sending SNACs. */ /* @@ -404,15 +384,19 @@ { FlapFrame *frame; aim_snacid_t snacid; - struct rateclass *rc; + GSList *tmp; frame = flap_frame_new(od, 0x02, 512); snacid = aim_cachesnac(od, 0x0001, 0x0008, 0x0000, NULL, 0); aim_putsnac(&frame->data, 0x0001, 0x0008, 0x0000, snacid); - for (rc = conn->rates; rc; rc = rc->next) - byte_stream_put16(&frame->data, rc->classid); + for (tmp = conn->rateclasses; tmp != NULL; tmp = tmp->next) + { + struct rateclass *rateclass; + rateclass = tmp->data; + byte_stream_put16(&frame->data, rateclass->classid); + } flap_connection_send(conn, frame); } @@ -423,15 +407,19 @@ { FlapFrame *frame; aim_snacid_t snacid; - struct rateclass *rc; + GSList *tmp; frame = flap_frame_new(od, 0x02, 512); snacid = aim_cachesnac(od, 0x0001, 0x0009, 0x0000, NULL, 0); aim_putsnac(&frame->data, 0x0001, 0x0009, 0x0000, snacid); - for (rc = conn->rates; rc; rc = rc->next) - byte_stream_put16(&frame->data, rc->classid); + for (tmp = conn->rateclasses; tmp != NULL; tmp = tmp->next) + { + struct rateclass *rateclass; + rateclass = tmp->data; + byte_stream_put16(&frame->data, rateclass->classid); + } flap_connection_send(conn, frame); } Modified: trunk/libgaim/protocols/oscar/flap_connection.c =================================================================== --- trunk/libgaim/protocols/oscar/flap_connection.c 2006-12-02 08:03:45 UTC (rev 17871) +++ trunk/libgaim/protocols/oscar/flap_connection.c 2006-12-02 08:37:24 UTC (rev 17872) @@ -184,28 +184,15 @@ } static void -flap_connection_destroy_rates(struct rateclass *head) +flap_connection_destroy_rateclass(struct rateclass *rateclass) { - struct rateclass *rc; - - for (rc = head; rc; ) + while (rateclass->members != NULL) { - struct rateclass *tmp; - struct snacpair *sp; - - tmp = rc->next; - - for (sp = rc->members; sp; ) { - struct snacpair *tmpsp; - - tmpsp = sp->next; - free(sp); - sp = tmpsp; - } - free(rc); - - rc = tmp; + g_free(rateclass->members->data); + rateclass->members = g_slist_delete_link(rateclass->members, rateclass->members); } + + free(rateclass); } static gboolean @@ -269,7 +256,11 @@ flap_connection_destroy_chat(od, conn); g_slist_free(conn->groups); - flap_connection_destroy_rates(conn->rates); + while (conn->rateclasses != NULL) + { + flap_connection_destroy_rateclass(conn->rateclasses->data); + conn->rateclasses = g_slist_delete_link(conn->rateclasses, conn->rateclasses); + } g_free(conn); Modified: trunk/libgaim/protocols/oscar/oscar.h =================================================================== --- trunk/libgaim/protocols/oscar/oscar.h 2006-12-02 08:03:45 UTC (rev 17871) +++ trunk/libgaim/protocols/oscar/oscar.h 2006-12-02 08:37:24 UTC (rev 17872) @@ -384,7 +384,8 @@ guint16 seqnum; /**< The sequence number of most recent outgoing packet. */ guint32 status; GSList *groups; - struct rateclass *rates; + GSList *rateclasses; /* Contains nodes of struct rateclass */ + /* TODO: Maybe use a GHashTable for rateclasses */ void *internal; /* internal conn-specific libfaim data */ }; @@ -1560,7 +1561,6 @@ struct snacpair { guint16 group; guint16 subtype; - struct snacpair *next; }; struct rateclass { @@ -1573,8 +1573,8 @@ guint32 current; guint32 max; guint8 unknown[5]; /* only present in versions >= 3 */ - struct snacpair *members; - struct rateclass *next; + GSList *members; /* Contains node of struct snacpair */ + /* TODO: Maybe use a GHashTable for members */ }; int aim_cachecookie(OscarData *od, IcbmCookie *cookie); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <the...@us...> - 2006-12-02 08:07:37
|
Revision: 17871 http://svn.sourceforge.net/gaim/?rev=17871&view=rev Author: thekingant Date: 2006-12-02 00:03:45 -0800 (Sat, 02 Dec 2006) Log Message: ----------- Minor cleanup. Mostly make some functions void instead of int where the return value was always 0 and wasn't used Modified Paths: -------------- trunk/libgaim/protocols/oscar/family_admin.c trunk/libgaim/protocols/oscar/family_advert.c trunk/libgaim/protocols/oscar/family_bos.c trunk/libgaim/protocols/oscar/family_feedbag.c trunk/libgaim/protocols/oscar/family_oservice.c trunk/libgaim/protocols/oscar/flap_connection.c trunk/libgaim/protocols/oscar/misc.c trunk/libgaim/protocols/oscar/oscar.c trunk/libgaim/protocols/oscar/oscar.h Modified: trunk/libgaim/protocols/oscar/family_admin.c =================================================================== --- trunk/libgaim/protocols/oscar/family_admin.c 2006-12-02 03:12:57 UTC (rev 17870) +++ trunk/libgaim/protocols/oscar/family_admin.c 2006-12-02 08:03:45 UTC (rev 17871) @@ -207,10 +207,10 @@ * get the TRIAL flag removed from your account. * */ -int +void aim_admin_reqconfirm(OscarData *od, FlapConnection *conn) { - return aim_genericreq_n(od, conn, 0x0007, 0x0006); + aim_genericreq_n(od, conn, 0x0007, 0x0006); } /* Modified: trunk/libgaim/protocols/oscar/family_advert.c =================================================================== --- trunk/libgaim/protocols/oscar/family_advert.c 2006-12-02 03:12:57 UTC (rev 17870) +++ trunk/libgaim/protocols/oscar/family_advert.c 2006-12-02 08:03:45 UTC (rev 17871) @@ -25,9 +25,10 @@ #include "oscar.h" -int aim_ads_requestads(OscarData *od, FlapConnection *conn) +void +aim_ads_requestads(OscarData *od, FlapConnection *conn) { - return aim_genericreq_n(od, conn, 0x0005, 0x0002); + aim_genericreq_n(od, conn, 0x0005, 0x0002); } static int snachandler(OscarData *od, FlapConnection *conn, aim_module_t *mod, FlapFrame *rx, aim_modsnac_t *snac, ByteStream *bs) Modified: trunk/libgaim/protocols/oscar/family_bos.c =================================================================== --- trunk/libgaim/protocols/oscar/family_bos.c 2006-12-02 03:12:57 UTC (rev 17870) +++ trunk/libgaim/protocols/oscar/family_bos.c 2006-12-02 08:03:45 UTC (rev 17871) @@ -78,9 +78,10 @@ * a bitwise OR of all the user classes you want to see you. * */ -int aim_bos_setgroupperm(OscarData *od, FlapConnection *conn, guint32 mask) +void +aim_bos_setgroupperm(OscarData *od, FlapConnection *conn, guint32 mask) { - return aim_genericreq_l(od, conn, 0x0009, 0x0004, &mask); + aim_genericreq_l(od, conn, 0x0009, 0x0004, &mask); } /* Modified: trunk/libgaim/protocols/oscar/family_feedbag.c =================================================================== --- trunk/libgaim/protocols/oscar/family_feedbag.c 2006-12-02 03:12:57 UTC (rev 17870) +++ trunk/libgaim/protocols/oscar/family_feedbag.c 2006-12-02 08:03:45 UTC (rev 17871) @@ -1350,7 +1350,9 @@ if (!od || !(conn = flap_connection_findbygroup(od, SNAC_FAMILY_FEEDBAG))) return -EINVAL; - return aim_genericreq_n(od, conn, SNAC_FAMILY_FEEDBAG, 0x0007); + aim_genericreq_n(od, conn, SNAC_FAMILY_FEEDBAG, 0x0007); + + return 0; } /* @@ -1694,7 +1696,9 @@ if (!od || !(conn = flap_connection_findbygroup(od, SNAC_FAMILY_FEEDBAG))) return -EINVAL; - return aim_genericreq_n(od, conn, SNAC_FAMILY_FEEDBAG, SNAC_SUBTYPE_FEEDBAG_EDITSTART); + aim_genericreq_n(od, conn, SNAC_FAMILY_FEEDBAG, SNAC_SUBTYPE_FEEDBAG_EDITSTART); + + return 0; } /* @@ -1710,7 +1714,9 @@ if (!od || !(conn = flap_connection_findbygroup(od, SNAC_FAMILY_FEEDBAG))) return -EINVAL; - return aim_genericreq_n(od, conn, SNAC_FAMILY_FEEDBAG, SNAC_SUBTYPE_FEEDBAG_EDITSTOP); + aim_genericreq_n(od, conn, SNAC_FAMILY_FEEDBAG, SNAC_SUBTYPE_FEEDBAG_EDITSTOP); + + return 0; } /* Modified: trunk/libgaim/protocols/oscar/family_oservice.c =================================================================== --- trunk/libgaim/protocols/oscar/family_oservice.c 2006-12-02 03:12:57 UTC (rev 17870) +++ trunk/libgaim/protocols/oscar/family_oservice.c 2006-12-02 08:03:45 UTC (rev 17871) @@ -93,19 +93,20 @@ * give it. * */ - aim_setversions(od, conn); + aim_srv_setversions(od, conn); return 1; } /* Subtype 0x0004 - Service request */ -int aim_reqservice(OscarData *od, guint16 serviceid) +void +aim_srv_requestnew(OscarData *od, guint16 serviceid) { FlapConnection *conn; conn = flap_connection_findbygroup(od, SNAC_FAMILY_BOS); - return aim_genericreq_s(od, conn, 0x0001, 0x0004, &serviceid); + aim_genericreq_s(od, conn, 0x0001, 0x0004, &serviceid); } /* @@ -205,7 +206,7 @@ /* Subtype 0x0006 - Request Rate Information. */ void -aim_reqrates(OscarData *od, FlapConnection *conn) +aim_srv_reqrates(OscarData *od, FlapConnection *conn) { aim_genericreq_n_snacid(od, conn, 0x0001, 0x0006); } @@ -256,6 +257,9 @@ * system is how the actual numbers relate to the passing of time. This * seems to be a big mystery. * + * See joscar's javadoc for the RateClassInfo class for a great + * explanation. You might be able to find it at + * http://dscoder.com/RateClassInfo.html */ static void @@ -383,7 +387,7 @@ * Last step in the conn init procedure is to acknowledge that we * agree to these draconian limitations. */ - aim_rates_addparam(od, conn); + aim_srv_rates_addparam(od, conn); /* * Finally, tell the client it's ready to go... @@ -396,7 +400,7 @@ /* Subtype 0x0008 - Add Rate Parameter */ void -aim_rates_addparam(OscarData *od, FlapConnection *conn) +aim_srv_rates_addparam(OscarData *od, FlapConnection *conn) { FlapFrame *frame; aim_snacid_t snacid; @@ -415,7 +419,7 @@ /* Subtype 0x0009 - Delete Rate Parameter */ void -aim_rates_delparam(OscarData *od, FlapConnection *conn) +aim_srv_rates_delparam(OscarData *od, FlapConnection *conn) { FlapFrame *frame; aim_snacid_t snacid; @@ -487,7 +491,7 @@ /* * Subtype 0x000c - Service Pause Acknowledgement * - * It is rather important that aim_sendpauseack() gets called for the exact + * It is rather important that aim_srv_sendpauseack() gets called for the exact * same connection that the Server Pause callback was called for, since * libfaim extracts the data for the SNAC from the connection structure. * @@ -496,7 +500,7 @@ * */ void -aim_sendpauseack(OscarData *od, FlapConnection *conn) +aim_srv_sendpauseack(OscarData *od, FlapConnection *conn) { FlapFrame *frame; aim_snacid_t snacid; @@ -533,7 +537,7 @@ /* Subtype 0x000e - Request self-info */ void -aim_reqpersonalinfo(OscarData *od, FlapConnection *conn) +aim_srv_reqpersonalinfo(OscarData *od, FlapConnection *conn) { aim_genericreq_n_snacid(od, conn, 0x0001, 0x000e); } @@ -589,15 +593,13 @@ * call it again with zero when you're back. * */ -int +void aim_srv_setidle(OscarData *od, guint32 idletime) { FlapConnection *conn; - if (!od || !(conn = flap_connection_findbygroup(od, SNAC_FAMILY_BOS))) - return -EINVAL; - - return aim_genericreq_l(od, conn, 0x0001, 0x0011, &idletime); + conn = flap_connection_findbygroup(od, SNAC_FAMILY_BOS); + aim_genericreq_l(od, conn, 0x0001, 0x0011, &idletime); } /* @@ -703,10 +705,10 @@ * Bit 2: Allows other AIM users to see how long you've been a member. * */ -int -aim_bos_setprivacyflags(OscarData *od, FlapConnection *conn, guint32 flags) +void +aim_srv_setprivacyflags(OscarData *od, FlapConnection *conn, guint32 flags) { - return aim_genericreq_l(od, conn, 0x0001, 0x0014, &flags); + aim_genericreq_l(od, conn, 0x0001, 0x0014, &flags); } /* @@ -718,10 +720,10 @@ * Wha? No? Since when? I think WinAIM sends an empty channel 5 * FLAP as a no-op... */ -int -aim_nop(OscarData *od, FlapConnection *conn) +void +aim_srv_nop(OscarData *od, FlapConnection *conn) { - return aim_genericreq_n(od, conn, 0x0001, 0x0016); + aim_genericreq_n(od, conn, 0x0001, 0x0016); } /* @@ -738,7 +740,7 @@ * */ void -aim_setversions(OscarData *od, FlapConnection *conn) +aim_srv_setversions(OscarData *od, FlapConnection *conn) { FlapFrame *frame; aim_snacid_t snacid; @@ -782,7 +784,7 @@ /* * Now request rates. */ - aim_reqrates(od, conn); + aim_srv_reqrates(od, conn); return 1; } @@ -805,7 +807,7 @@ * TODO: Combine this with the function below. */ int -aim_setextstatus(OscarData *od, guint32 status) +aim_srv_setextstatus(OscarData *od, guint32 status) { FlapConnection *conn; FlapFrame *frame; Modified: trunk/libgaim/protocols/oscar/flap_connection.c =================================================================== --- trunk/libgaim/protocols/oscar/flap_connection.c 2006-12-02 03:12:57 UTC (rev 17870) +++ trunk/libgaim/protocols/oscar/flap_connection.c 2006-12-02 08:03:45 UTC (rev 17871) @@ -681,6 +681,8 @@ break; } + /* TODO: Verify the sequence number sent by the server. */ + /* Initialize a new temporary FlapFrame for incoming data */ conn->buffer_incoming.channel = aimutil_get8(&header[1]); conn->buffer_incoming.seqnum = aimutil_get16(&header[2]); Modified: trunk/libgaim/protocols/oscar/misc.c =================================================================== --- trunk/libgaim/protocols/oscar/misc.c 2006-12-02 03:12:57 UTC (rev 17870) +++ trunk/libgaim/protocols/oscar/misc.c 2006-12-02 08:03:45 UTC (rev 17871) @@ -36,7 +36,7 @@ * back to the single. I don't see any advantage to doing it either way. * */ -int +void aim_genericreq_n(OscarData *od, FlapConnection *conn, guint16 family, guint16 subtype) { FlapFrame *frame; @@ -47,8 +47,6 @@ aim_putsnac(&frame->data, family, subtype, 0x0000, snacid); flap_connection_send(conn, frame); - - return 0; } void @@ -65,7 +63,7 @@ flap_connection_send(conn, frame); } -int +void aim_genericreq_l(OscarData *od, FlapConnection *conn, guint16 family, guint16 subtype, guint32 *longdata) { FlapFrame *frame; @@ -82,11 +80,9 @@ byte_stream_put32(&frame->data, *longdata); flap_connection_send(conn, frame); - - return 0; } -int +void aim_genericreq_s(OscarData *od, FlapConnection *conn, guint16 family, guint16 subtype, guint16 *shortdata) { FlapFrame *frame; @@ -103,8 +99,6 @@ byte_stream_put16(&frame->data, *shortdata); flap_connection_send(conn, frame); - - return 0; } /* Modified: trunk/libgaim/protocols/oscar/oscar.c =================================================================== --- trunk/libgaim/protocols/oscar/oscar.c 2006-12-02 03:12:57 UTC (rev 17870) +++ trunk/libgaim/protocols/oscar/oscar.c 2006-12-02 08:03:45 UTC (rev 17871) @@ -1000,7 +1000,7 @@ { GaimConnection *gc = od->gc; - aim_reqpersonalinfo(od, conn); + aim_srv_reqpersonalinfo(od, conn); gaim_debug_info("oscar", "ssi: requesting rights and list\n"); aim_ssi_reqrights(od); @@ -3202,7 +3202,7 @@ conn = flap_connection_getbytype(od, SNAC_FAMILY_BART); if (!conn) { if (!od->iconconnecting) { - aim_reqservice(od, SNAC_FAMILY_BART); + aim_srv_requestnew(od, SNAC_FAMILY_BART); od->iconconnecting = TRUE; } return FALSE; @@ -3527,7 +3527,7 @@ gaim_account_get_bool(account, "web_aware", OSCAR_DEFAULT_WEB_AWARE)); } - aim_reqservice(od, SNAC_FAMILY_CHATNAV); + aim_srv_requestnew(od, SNAC_FAMILY_CHATNAV); /* * The "if" statement here is a pathetic attempt to not attempt to @@ -3539,7 +3539,7 @@ * of an annoying error at signon for @anythingelse.com accounts. */ if ((od->authinfo->email != NULL) && ((strchr(gc->account->username, '@') == NULL))) - aim_reqservice(od, SNAC_FAMILY_ALERT); + aim_srv_requestnew(od, SNAC_FAMILY_ALERT); return 1; } @@ -4299,7 +4299,7 @@ else if (!strcmp(status_id, OSCAR_STATUS_ID_CUSTOM)) data |= AIM_ICQ_STATE_OUT | AIM_ICQ_STATE_AWAY; - aim_setextstatus(od, data); + aim_srv_setextstatus(od, data); } static void @@ -5174,7 +5174,7 @@ cr->exchange = atoi(exchange); cr->name = g_strdup(name); od->create_rooms = g_slist_prepend(od->create_rooms, cr); - aim_reqservice(od, SNAC_FAMILY_CHATNAV); + aim_srv_requestnew(od, SNAC_FAMILY_CHATNAV); } } @@ -5493,7 +5493,7 @@ if (!flap_connection_getbytype(od, SNAC_FAMILY_BART) && !od->iconconnecting) { od->iconconnecting = TRUE; od->set_icon = TRUE; - aim_reqservice(od, SNAC_FAMILY_BART); + aim_srv_requestnew(od, SNAC_FAMILY_BART); } else { struct stat st; char *iconfile = gaim_buddy_icons_get_full_path(gaim_account_get_buddy_icon(gaim_connection_get_account(gc))); @@ -5935,7 +5935,7 @@ if (!flap_connection_getbytype(od, SNAC_FAMILY_ADMIN)) { od->setnick = TRUE; od->newsn = g_strdup(nick); - aim_reqservice(od, SNAC_FAMILY_ADMIN); + aim_srv_requestnew(od, SNAC_FAMILY_ADMIN); } else { aim_admin_setnick(od, flap_connection_getbytype(od, SNAC_FAMILY_ADMIN), nick); } @@ -5969,7 +5969,7 @@ aim_admin_reqconfirm(od, conn); } else { od->conf = TRUE; - aim_reqservice(od, SNAC_FAMILY_ADMIN); + aim_srv_requestnew(od, SNAC_FAMILY_ADMIN); } } @@ -5983,7 +5983,7 @@ aim_admin_getinfo(od, conn, 0x11); } else { od->reqemail = TRUE; - aim_reqservice(od, SNAC_FAMILY_ADMIN); + aim_srv_requestnew(od, SNAC_FAMILY_ADMIN); } } @@ -5997,7 +5997,7 @@ } else { od->setemail = TRUE; od->email = g_strdup(email); - aim_reqservice(od, SNAC_FAMILY_ADMIN); + aim_srv_requestnew(od, SNAC_FAMILY_ADMIN); } } @@ -6328,7 +6328,7 @@ od->chpass = TRUE; od->oldp = g_strdup(old); od->newp = g_strdup(new); - aim_reqservice(od, SNAC_FAMILY_ADMIN); + aim_srv_requestnew(od, SNAC_FAMILY_ADMIN); } } } Modified: trunk/libgaim/protocols/oscar/oscar.h =================================================================== --- trunk/libgaim/protocols/oscar/oscar.h 2006-12-02 03:12:57 UTC (rev 17870) +++ trunk/libgaim/protocols/oscar/oscar.h 2006-12-02 08:03:45 UTC (rev 17871) @@ -63,7 +63,6 @@ typedef struct _IcbmArgsCh2 IcbmArgsCh2; typedef guint32 aim_snacid_t; -typedef guint16 flap_seqnum_t; #include "snactypes.h" @@ -355,7 +354,7 @@ struct _FlapFrame { guint8 channel; - flap_seqnum_t seqnum; + guint16 seqnum; ByteStream data; /* payload stream */ }; @@ -382,7 +381,7 @@ guint16 type; guint16 subtype; - flap_seqnum_t seqnum; + guint16 seqnum; /**< The sequence number of most recent outgoing packet. */ guint32 status; GSList *groups; struct rateclass *rates; @@ -585,16 +584,10 @@ void flap_connection_send_keepalive(OscarData *od, FlapConnection *conn); FlapFrame *flap_frame_new(OscarData *od, guint16 channel, int datalen); - OscarData *oscar_data_new(void); void oscar_data_destroy(OscarData *); -/* 0x0001 - family_oservice.c */ -int aim_srv_setstatusmsg(OscarData *od, const char *msg); -int aim_srv_setidle(OscarData *od, guint32 idletime); - /* misc.c */ - #define AIM_VISIBILITYCHANGE_PERMITADD 0x05 #define AIM_VISIBILITYCHANGE_PERMITREMOVE 0x06 #define AIM_VISIBILITYCHANGE_DENYADD 0x07 @@ -605,15 +598,29 @@ #define AIM_WARN_ANON 0x01 -int aim_nop(OscarData *, FlapConnection *); -int aim_bos_changevisibility(OscarData *, FlapConnection *, int, const char *); -int aim_bos_setgroupperm(OscarData *, FlapConnection *, guint32 mask); -int aim_bos_setprivacyflags(OscarData *, FlapConnection *, guint32); -void aim_reqpersonalinfo(OscarData *, FlapConnection *); -int aim_reqservice(OscarData *, guint16); -void aim_bos_reqrights(OscarData *, FlapConnection *); -int aim_setextstatus(OscarData *od, guint32 status); + +/* 0x0001 - family_oservice.c */ +/* 0x0004 */ void aim_srv_requestnew(OscarData *od, guint16 serviceid); +/* 0x0006 */ void aim_srv_reqrates(OscarData *od, FlapConnection *conn); +/* 0x0008 */ void aim_srv_rates_addparam(OscarData *od, FlapConnection *conn); +/* 0x0009 */ void aim_srv_rates_delparam(OscarData *od, FlapConnection *conn); +/* 0x000c */ void aim_srv_sendpauseack(OscarData *od, FlapConnection *conn); +/* 0x000e */ void aim_srv_reqpersonalinfo(OscarData *od, FlapConnection *conn); +/* 0x0011 */ void aim_srv_setidle(OscarData *od, guint32 idletime); +/* 0x0014 */ void aim_srv_setprivacyflags(OscarData *od, FlapConnection *conn, guint32); +/* 0x0016 */ void aim_srv_nop(OscarData *od, FlapConnection *conn); +/* 0x0017 */ void aim_srv_setversions(OscarData *od, FlapConnection *conn); +/* 0x001e */ int aim_srv_setstatusmsg(OscarData *od, const char *msg); +/* 0x001e */ int aim_srv_setextstatus(OscarData *od, guint32 status); + + +void aim_bos_reqrights(OscarData *od, FlapConnection *conn); +int aim_bos_changevisibility(OscarData *od, FlapConnection *conn, int, const char *); +void aim_bos_setgroupperm(OscarData *od, FlapConnection *conn, guint32 mask); + + + #define AIM_CLIENTTYPE_UNKNOWN 0x0000 #define AIM_CLIENTTYPE_MC 0x0001 #define AIM_CLIENTTYPE_WINAIM 0x0002 @@ -625,7 +632,7 @@ #define AIM_RATE_CODE_WARNING 0x0002 #define AIM_RATE_CODE_LIMIT 0x0003 #define AIM_RATE_CODE_CLEARLIMIT 0x0004 -int aim_ads_requestads(OscarData *od, FlapConnection *conn); +void aim_ads_requestads(OscarData *od, FlapConnection *conn); @@ -1292,7 +1299,7 @@ /* 0x0017 - family_auth.c */ void aim_sendcookie(OscarData *, FlapConnection *, const guint16 length, const guint8 *); int aim_admin_changepasswd(OscarData *, FlapConnection *, const char *newpw, const char *curpw); -int aim_admin_reqconfirm(OscarData *od, FlapConnection *conn); +void aim_admin_reqconfirm(OscarData *od, FlapConnection *conn); int aim_admin_getinfo(OscarData *od, FlapConnection *conn, guint16 info); int aim_admin_setemail(OscarData *od, FlapConnection *conn, const char *newemail); int aim_admin_setnick(OscarData *od, FlapConnection *conn, const char *newnick); @@ -1489,10 +1496,10 @@ int icq_modfirst(OscarData *od, aim_module_t *mod); int email_modfirst(OscarData *od, aim_module_t *mod); -int aim_genericreq_n(OscarData *, FlapConnection *conn, guint16 family, guint16 subtype); -void aim_genericreq_n_snacid(OscarData *, FlapConnection *conn, guint16 family, guint16 subtype); -int aim_genericreq_l(OscarData *, FlapConnection *conn, guint16 family, guint16 subtype, guint32 *); -int aim_genericreq_s(OscarData *, FlapConnection *conn, guint16 family, guint16 subtype, guint16 *); +void aim_genericreq_n(OscarData *od, FlapConnection *conn, guint16 family, guint16 subtype); +void aim_genericreq_n_snacid(OscarData *od, FlapConnection *conn, guint16 family, guint16 subtype); +void aim_genericreq_l(OscarData *od, FlapConnection *conn, guint16 family, guint16 subtype, guint32 *); +void aim_genericreq_s(OscarData *od, FlapConnection *conn, guint16 family, guint16 subtype, guint16 *); /* bstream.c */ int byte_stream_init(ByteStream *bs, guint8 *data, int len); @@ -1582,17 +1589,6 @@ void flap_connection_destroy_chat(OscarData *od, FlapConnection *conn); -/* These are all handled internally now. */ -void aim_setversions(OscarData *od, FlapConnection *conn); -void aim_reqrates(OscarData *, FlapConnection *); -void aim_rates_addparam(OscarData *, FlapConnection *); -void aim_rates_delparam(OscarData *, FlapConnection *); -void aim_sendpauseack(OscarData *od, FlapConnection *conn); - - - - - #ifdef __cplusplus } #endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <amc...@us...> - 2006-12-02 03:13:07
|
Revision: 17870 http://svn.sourceforge.net/gaim/?rev=17870&view=rev Author: amc_grim Date: 2006-12-01 19:12:57 -0800 (Fri, 01 Dec 2006) Log Message: ----------- Fix this before it becomes a problem. But basically, if the first call to PKG_CHECK_MODULES is in a conditional block, and that condition is not matched, configure will die on the next call to PKG_CHECK_MODULES. This stops that from happening by forcing the initialization or whatever of pkg-config to always happend. Modified Paths: -------------- trunk/configure.ac Modified: trunk/configure.ac =================================================================== --- trunk/configure.ac 2006-12-01 23:34:40 UTC (rev 17869) +++ trunk/configure.ac 2006-12-02 03:12:57 UTC (rev 17870) @@ -19,6 +19,8 @@ LIBTOOL="$LIBTOOL --silent" AC_PROG_INSTALL AC_PROG_INTLTOOL +PKG_PROG_PKG_CONFIG + GETTEXT_PACKAGE=gaim AC_SUBST(GETTEXT_PACKAGE) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sea...@us...> - 2006-12-01 23:34:41
|
Revision: 17869 http://svn.sourceforge.net/gaim/?rev=17869&view=rev Author: seanegan Date: 2006-12-01 15:34:40 -0800 (Fri, 01 Dec 2006) Log Message: ----------- A few tweaks to new statusbox look and feel. Modified Paths: -------------- trunk/gtk/gtkstatusbox.c Modified: trunk/gtk/gtkstatusbox.c =================================================================== --- trunk/gtk/gtkstatusbox.c 2006-12-01 20:02:32 UTC (rev 17868) +++ trunk/gtk/gtkstatusbox.c 2006-12-01 23:34:40 UTC (rev 17869) @@ -767,8 +767,8 @@ break; } g_free(name); - } - else if ((type == GTK_GAIM_STATUS_BOX_TYPE_POPULAR) && + + } else if ((type == GTK_GAIM_STATUS_BOX_TYPE_POPULAR) && (GPOINTER_TO_INT(data) == gaim_savedstatus_get_creation_time(saved_status))) { /* Found! */ @@ -1252,6 +1252,31 @@ } } +popup_grab_on_window (GdkWindow *window, + guint32 activate_time, + gboolean grab_keyboard) +{ + if ((gdk_pointer_grab (window, TRUE, + GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | + GDK_POINTER_MOTION_MASK, + NULL, NULL, activate_time) == 0)) + { + if (!grab_keyboard || + gdk_keyboard_grab (window, TRUE, + activate_time) == 0) + return TRUE; + else + { + gdk_display_pointer_ungrab (gdk_drawable_get_display (window), + activate_time); + return FALSE; + } + } + + return FALSE; +} + + static void gaim_gtk_status_box_popup(GtkGaimStatusBox *box) { @@ -1261,7 +1286,17 @@ gtk_widget_set_size_request (box->popup_window, width, height); gtk_window_move (GTK_WINDOW (box->popup_window), x, y); gtk_widget_show(box->popup_window); + gtk_widget_grab_focus (box->tree_view); + if (!popup_grab_on_window (box->popup_window->window, + GDK_CURRENT_TIME, TRUE)) { + gtk_widget_hide (box->popup_window); + return; + } + gtk_grab_add (box->popup_window); box->popup_in_progress = TRUE; + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (box->toggle_button), + TRUE); + } static void @@ -1270,7 +1305,7 @@ box->popup_in_progress = FALSE; gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (box->toggle_button), FALSE); - + gtk_grab_remove (box->popup_window); } @@ -1366,11 +1401,33 @@ treeview_button_release_cb(GtkWidget *widget, GdkEventButton *event, GtkGaimStatusBox *status_box) { GtkTreePath *path = NULL; - int ret = gtk_tree_view_get_path_at_pos (GTK_TREE_VIEW (status_box->tree_view), + int ret; + GtkWidget *ewidget = gtk_get_event_widget ((GdkEvent *)event); + + if (ewidget != status_box->tree_view) { + if (ewidget == status_box->toggle_button && + !status_box->popup_in_progress && + gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (status_box->toggle_button))) { + gaim_gtk_status_box_popdown (status_box); + return TRUE; + } + + /* released outside treeview */ + if (ewidget != status_box->toggle_button) + { + gaim_gtk_status_box_popdown (status_box); + return TRUE; + } + + return FALSE; + } + + ret = gtk_tree_view_get_path_at_pos (GTK_TREE_VIEW (status_box->tree_view), event->x, event->y, &path, NULL, NULL, NULL); + if (!ret) return TRUE; /* clicked outside window? */ @@ -1524,7 +1581,7 @@ g_signal_connect(G_OBJECT(status_box), "scroll_event", G_CALLBACK(combo_box_scroll_event_cb), NULL); g_signal_connect(G_OBJECT(status_box->imhtml), "scroll_event", G_CALLBACK(imhtml_scroll_event_cb), status_box->imhtml); - g_signal_connect(G_OBJECT(status_box->tree_view), "button_release_event", G_CALLBACK(treeview_button_release_cb), status_box); + g_signal_connect(G_OBJECT(status_box->popup_window), "button_release_event", G_CALLBACK(treeview_button_release_cb), status_box); #if GTK_CHECK_VERSION(2,6,0) gtk_tree_view_set_row_separator_func(GTK_TREE_VIEW(status_box->tree_view), dropdown_store_row_separator_func, NULL, NULL); @@ -1571,7 +1628,7 @@ /* If the gtkimhtml is visible, then add some additional padding */ gtk_widget_size_request(GTK_GAIM_STATUS_BOX(widget)->vbox, &box_req); if (box_req.height > 1) - requisition->height += box_req.height + 3; + requisition->height += box_req.height + border_width; requisition->width = 1; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dat...@us...> - 2006-12-01 20:02:36
|
Revision: 17868 http://svn.sourceforge.net/gaim/?rev=17868&view=rev Author: datallah Date: 2006-12-01 12:02:32 -0800 (Fri, 01 Dec 2006) Log Message: ----------- wingaim build process no longer needs to re-build everything for the non-debug version. `make -f Makefile.mingw installers` will now produce the "regular", "no-gtk" and "debug" installers. Modified Paths: -------------- trunk/Makefile.mingw trunk/gaim-installer.nsi Property Changed: ---------------- trunk/ Property changes on: trunk ___________________________________________________________________ Name: svn:ignore - ABOUT-NLS aclocal.m4 autom4te.cache compile confdefs.h config.cache config.guess config.h config.h.in config.h.in~ config.log config.status config.sub configure configure.2.1x depcomp Doxyfile gaim.apspec gaim.desktop gaim.pc gaim.service gaim.spec install-sh intl intltool-extract intltool-extract.in intltool-merge intltool-merge.in intltool-update intltool-update.in libtool ltconfig ltmain.sh Makefile Makefile.in missing mkinstalldirs stamp-h stamp-h1 stamp-h.in *.swp .temp-gettextize win32-install-dir gaim-*.exe VERSION + ABOUT-NLS aclocal.m4 autom4te.cache compile confdefs.h config.cache config.guess config.h config.h.in config.h.in~ config.log config.status config.sub configure configure.2.1x depcomp Doxyfile gaim.apspec gaim.desktop gaim.pc gaim.service gaim.spec install-sh intl intltool-extract intltool-extract.in intltool-merge intltool-merge.in intltool-update intltool-update.in libtool ltconfig ltmain.sh Makefile Makefile.in missing mkinstalldirs stamp-h stamp-h1 stamp-h.in *.swp .temp-gettextize win32-install-dir* gaim-*.exe VERSION Modified: trunk/Makefile.mingw =================================================================== --- trunk/Makefile.mingw 2006-12-01 09:47:20 UTC (rev 17867) +++ trunk/Makefile.mingw 2006-12-01 20:02:32 UTC (rev 17868) @@ -31,8 +31,28 @@ exit; \ }' VERSION) -.PHONY: all install installer installer_nogtk installer_debug installers clean uninstall +# Any *.dll or *.exe files included in win32-install-dir that we don't compile +# should be included in this list so they don't get stripped +NON_GAIM_DLLS = \ + freebl3.dll \ + libgtkspell.dll \ + libmeanwhile-1.dll \ + libxml2.dll \ + nspr4.dll \ + nss3.dll \ + nssckbi.dll \ + plc4.dll \ + plds4.dll \ + silc.dll \ + silcclient.dll \ + softokn3.dll \ + ssl3.dll +#build an expression for `find` to use to ignore the above files +NON_GAIM_DLLS_FIND_EXP = $(patsubst %,-o -name %,$(NON_GAIM_DLLS)) + +.PHONY: all install installer installer_nogtk installer_debug installers clean uninstall create_release_install_dir + all: $(GAIM_CONFIG_H) $(MAKE) -C $(GAIM_LIB_TOP) -f $(GAIM_WIN32_MAKEFILE) $(MAKE) -C $(GAIM_GTK_TOP) -f $(GAIM_WIN32_MAKEFILE) @@ -43,16 +63,22 @@ $(MAKE) -C $(GAIM_GTK_TOP) -f $(GAIM_WIN32_MAKEFILE) install $(MAKE) -C $(GAIM_PO_TOP) -f $(GAIM_WIN32_MAKEFILE) install -installer: install - $(MAKENSIS) /V3 /DGAIM_VERSION="$(GAIM_VERSION)" /DGAIM_PRODUCT_VERSION="$(GAIM_PRODUCT_VERSION)" /DWITH_GTK gaim-installer.nsi +create_release_install_dir: install + rm -rf $(GAIM_INSTALL_DIR).release + cp -R $(GAIM_INSTALL_DIR) $(GAIM_INSTALL_DIR).release + find $(GAIM_INSTALL_DIR).release \( -name '*.dll' -o -name '*.exe' \) \ + -not \( -false $(NON_GAIM_DLLS_FIND_EXP) \) -exec strip --strip-unneeded {} ';' -installer_nogtk: install - $(MAKENSIS) /V3 /DGAIM_VERSION="$(GAIM_VERSION)" /DGAIM_PRODUCT_VERSION="$(GAIM_PRODUCT_VERSION)" gaim-installer.nsi +installer: create_release_install_dir + $(MAKENSIS) /V3 /DGAIM_VERSION="$(GAIM_VERSION)" /DGAIM_PRODUCT_VERSION="$(GAIM_PRODUCT_VERSION)" /DWITH_GTK /DGAIM_INSTALL_DIR="$(GAIM_INSTALL_DIR).release" gaim-installer.nsi +installer_nogtk: create_release_install_dir + $(MAKENSIS) /V3 /DGAIM_VERSION="$(GAIM_VERSION)" /DGAIM_PRODUCT_VERSION="$(GAIM_PRODUCT_VERSION)" /DGAIM_INSTALL_DIR="$(GAIM_INSTALL_DIR).release" gaim-installer.nsi + installer_debug: install - $(MAKENSIS) /V3 /DGAIM_VERSION="$(GAIM_VERSION)" /DGAIM_PRODUCT_VERSION="$(GAIM_PRODUCT_VERSION)" /DDEBUG gaim-installer.nsi + $(MAKENSIS) /V3 /DGAIM_VERSION="$(GAIM_VERSION)" /DGAIM_PRODUCT_VERSION="$(GAIM_PRODUCT_VERSION)" /DGAIM_INSTALL_DIR="$(GAIM_INSTALL_DIR)" /DDEBUG gaim-installer.nsi -installers: installer installer_nogtk +installers: installer installer_nogtk installer_debug clean: $(MAKE) -C $(GAIM_PO_TOP) -f $(GAIM_WIN32_MAKEFILE) clean @@ -61,6 +87,6 @@ rm -f $(GAIM_CONFIG_H) gaim*.exe uninstall: - rm -rf $(GAIM_INSTALL_PERLMOD_DIR) $(GAIM_INSTALL_PLUGINS_DIR) $(GAIM_INSTALL_PO_DIR) $(GAIM_INSTALL_DIR) + rm -rf $(GAIM_INSTALL_PERLMOD_DIR) $(GAIM_INSTALL_PLUGINS_DIR) $(GAIM_INSTALL_PO_DIR) $(GAIM_INSTALL_DIR) $(GAIM_INSTALL_DIR).release include $(GAIM_COMMON_TARGETS) Modified: trunk/gaim-installer.nsi =================================================================== --- trunk/gaim-installer.nsi 2006-12-01 09:47:20 UTC (rev 17867) +++ trunk/gaim-installer.nsi 2006-12-01 20:02:32 UTC (rev 17868) @@ -424,7 +424,7 @@ SetOutPath "$INSTDIR" ; Gaim files SetOverwrite on - File /r .\win32-install-dir\*.* + File /r ${GAIM_INSTALL_DIR}\*.* !ifdef DEBUG File "${GAIM_INSTALLER_DEPS}\exchndl.dll" !endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <the...@us...> - 2006-12-01 09:47:20
|
Revision: 17867 http://svn.sourceforge.net/gaim/?rev=17867&view=rev Author: thekingant Date: 2006-12-01 01:47:20 -0800 (Fri, 01 Dec 2006) Log Message: ----------- Get rid of some silly casting Modified Paths: -------------- trunk/libgaim/protocols/jabber/auth.c trunk/libgaim/protocols/jabber/buddy.c Modified: trunk/libgaim/protocols/jabber/auth.c =================================================================== --- trunk/libgaim/protocols/jabber/auth.c 2006-12-01 08:07:17 UTC (rev 17866) +++ trunk/libgaim/protocols/jabber/auth.c 2006-12-01 09:47:20 UTC (rev 17867) @@ -740,7 +740,7 @@ { const char *ns = xmlnode_get_namespace(packet); #ifdef HAVE_CYRUS_SASL - int *x; + const int *x; #endif if(!ns || strcmp(ns, "urn:ietf:params:xml:ns:xmpp-sasl")) { @@ -762,9 +762,9 @@ } } /* If we've negotiated a security layer, we need to enable it */ - sasl_getprop(js->sasl, SASL_SSF, (const void **)&x); - if (*x>0) { - sasl_getprop(js->sasl, SASL_MAXOUTBUF, (const void **)&x); + sasl_getprop(js->sasl, SASL_SSF, &x); + if (*x > 0) { + sasl_getprop(js->sasl, SASL_MAXOUTBUF, &x); js->sasl_maxbuf = *x; } #endif Modified: trunk/libgaim/protocols/jabber/buddy.c =================================================================== --- trunk/libgaim/protocols/jabber/buddy.c 2006-12-01 08:07:17 UTC (rev 17866) +++ trunk/libgaim/protocols/jabber/buddy.c 2006-12-01 09:47:20 UTC (rev 17867) @@ -68,6 +68,9 @@ JabberBuddy *jb; const char *realname; + if (js->buddies == NULL) + return NULL; + if(!(realname = jabber_normalize(js->gc->account, name))) return NULL; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <the...@us...> - 2006-12-01 08:07:21
|
Revision: 17866 http://svn.sourceforge.net/gaim/?rev=17866&view=rev Author: thekingant Date: 2006-12-01 00:07:17 -0800 (Fri, 01 Dec 2006) Log Message: ----------- Get rid of a bunch of compile warnings Modified Paths: -------------- trunk/gtk/gtkaccount.c trunk/libgaim/account.h trunk/libgaim/dbus-server.c trunk/libgaim/plugins/log_reader.c trunk/libgaim/protocols/msn/userlist.c trunk/libgaim/protocols/oscar/oscar.c Modified: trunk/gtk/gtkaccount.c =================================================================== --- trunk/gtk/gtkaccount.c 2006-12-01 07:07:22 UTC (rev 17865) +++ trunk/gtk/gtkaccount.c 2006-12-01 08:07:17 UTC (rev 17866) @@ -2381,8 +2381,8 @@ } struct auth_and_add { - void(*auth_cb)(void*); - void(*deny_cb)(void*); + GaimAccountRequestAuthorizationCb auth_cb; + GaimAccountRequestAuthorizationCb deny_cb; void *data; char *username; char *alias; @@ -2440,8 +2440,8 @@ if (!gaim_find_buddy(account, remote_user)) { struct auth_and_add *aa = g_new0(struct auth_and_add, 1); - aa->auth_cb = auth_cb; - aa->deny_cb = deny_cb; + aa->auth_cb = (GaimAccountRequestAuthorizationCb)auth_cb; + aa->deny_cb = (GaimAccountRequestAuthorizationCb)deny_cb; aa->data = user_data; aa->username = g_strdup(remote_user); aa->alias = g_strdup(alias); Modified: trunk/libgaim/account.h =================================================================== --- trunk/libgaim/account.h 2006-12-01 07:07:22 UTC (rev 17865) +++ trunk/libgaim/account.h 2006-12-01 08:07:17 UTC (rev 17866) @@ -34,6 +34,7 @@ typedef struct _GaimAccount GaimAccount; typedef gboolean (*GaimFilterAccountFunc)(GaimAccount *account); +typedef void (*GaimAccountRequestAuthorizationCb)(void *); #include "connection.h" #include "log.h" Modified: trunk/libgaim/dbus-server.c =================================================================== --- trunk/libgaim/dbus-server.c 2006-12-01 07:07:22 UTC (rev 17865) +++ trunk/libgaim/dbus-server.c 2006-12-01 08:07:17 UTC (rev 17866) @@ -668,7 +668,6 @@ guint xuint; gboolean xboolean; gpointer ptr = NULL; - gboolean allocated = FALSE; if (gaim_value_is_outgoing(gaim_values[i])) { @@ -693,13 +692,14 @@ case GAIM_TYPE_STRING: str = null_to_empty(my_arg(char*)); if (!g_utf8_validate(str, -1, NULL)) { + gchar *tmp; gaim_debug_error("dbus", "Invalid UTF-8 string passed to signal, emitting salvaged string!\n"); - str = gaim_utf8_salvage(str); - allocated = TRUE; + tmp = gaim_utf8_salvage(str); + dbus_message_iter_append_basic(iter, DBUS_TYPE_STRING, &tmp); + g_free(tmp); + } else { + dbus_message_iter_append_basic(iter, DBUS_TYPE_STRING, &str); } - dbus_message_iter_append_basic(iter, DBUS_TYPE_STRING, &str); - if (allocated) - g_free(str); break; case GAIM_TYPE_SUBTYPE: /* registered pointers only! */ case GAIM_TYPE_POINTER: Modified: trunk/libgaim/plugins/log_reader.c =================================================================== --- trunk/libgaim/plugins/log_reader.c 2006-12-01 07:07:22 UTC (rev 17865) +++ trunk/libgaim/plugins/log_reader.c 2006-12-01 08:07:17 UTC (rev 17866) @@ -1640,7 +1640,7 @@ while (*line2 && *line2 != ':') line2++; if (*line2 == ':') { - char *acct_name; + const char *acct_name; line2++; line = line2; acct_name = gaim_account_get_alias(log->account); Modified: trunk/libgaim/protocols/msn/userlist.c =================================================================== --- trunk/libgaim/protocols/msn/userlist.c 2006-12-01 07:07:22 UTC (rev 17865) +++ trunk/libgaim/protocols/msn/userlist.c 2006-12-01 08:07:17 UTC (rev 17866) @@ -74,7 +74,7 @@ pa->gc = gc; gaim_account_request_authorization(gaim_connection_get_account(gc), passport, NULL, friendly, NULL, - msn_accept_add_cb, msn_cancel_add_cb, pa); + G_CALLBACK(msn_accept_add_cb), G_CALLBACK(msn_cancel_add_cb), pa); } /************************************************************************** Modified: trunk/libgaim/protocols/oscar/oscar.c =================================================================== --- trunk/libgaim/protocols/oscar/oscar.c 2006-12-01 07:07:22 UTC (rev 17865) +++ trunk/libgaim/protocols/oscar/oscar.c 2006-12-01 08:07:17 UTC (rev 17866) @@ -2330,8 +2330,9 @@ data->name = sn; data->nick = NULL; - gaim_account_request_authorization(gaim_connection_get_account(gc), sn, NULL, NULL, reason, - G_CALLBACK(gaim_auth_grant), G_CALLBACK(gaim_auth_dontgrant_msgprompt), data); + gaim_account_request_authorization(account, sn, + NULL, NULL, reason, G_CALLBACK(gaim_auth_grant), + G_CALLBACK(gaim_auth_dontgrant_msgprompt), data); g_free(reason); } } break; @@ -5041,8 +5042,9 @@ data->name = g_strdup(sn); data->nick = NULL; - gaim_account_request_authorization(gaim_connection_get_account(gc), nombre, NULL, NULL, reason, - G_CALLBACK(gaim_auth_grant), G_CALLBACK(gaim_auth_dontgrant_msgprompt), data); + gaim_account_request_authorization(account, nombre, + NULL, NULL, reason, G_CALLBACK(gaim_auth_grant), + G_CALLBACK(gaim_auth_dontgrant_msgprompt), data); g_free(nombre); g_free(reason); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <the...@us...> - 2006-12-01 07:08:57
|
Revision: 17865 http://svn.sourceforge.net/gaim/?rev=17865&view=rev Author: thekingant Date: 2006-11-30 23:07:22 -0800 (Thu, 30 Nov 2006) Log Message: ----------- svn:ignore Makefile and Makefile.in Property Changed: ---------------- trunk/gtk/pixmaps/buddy_icons/ trunk/gtk/pixmaps/buddy_icons/qq/ Property changes on: trunk/gtk/pixmaps/buddy_icons ___________________________________________________________________ Name: svn:ignore + Makefile Makefile.in Property changes on: trunk/gtk/pixmaps/buddy_icons/qq ___________________________________________________________________ Name: svn:ignore + Makefile Makefile.in This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sea...@us...> - 2006-12-01 05:03:07
|
Revision: 17864 http://svn.sourceforge.net/gaim/?rev=17864&view=rev Author: seanegan Date: 2006-11-30 21:01:51 -0800 (Thu, 30 Nov 2006) Log Message: ----------- Work in progress. I'm committing this mostly so i can work on it from home. I'm hacking up statusbox to no longer descend from combobox to better get the appearance and behavior we want. Seems mostly functional, but a lot of looes ends to tie up. Modified Paths: -------------- trunk/gtk/gtkstatusbox.c trunk/gtk/gtkstatusbox.h Modified: trunk/gtk/gtkstatusbox.c =================================================================== --- trunk/gtk/gtkstatusbox.c 2006-12-01 04:38:54 UTC (rev 17863) +++ trunk/gtk/gtkstatusbox.c 2006-12-01 05:01:51 UTC (rev 17864) @@ -73,21 +73,19 @@ static void gtk_gaim_status_box_refresh(GtkGaimStatusBox *status_box); static void status_menu_refresh_iter(GtkGaimStatusBox *status_box); static void gtk_gaim_status_box_regenerate(GtkGaimStatusBox *status_box); -static void gtk_gaim_status_box_changed(GtkComboBox *box); +static void gtk_gaim_status_box_changed(GtkGaimStatusBox *box); static void gtk_gaim_status_box_size_request (GtkWidget *widget, GtkRequisition *requisition); static void gtk_gaim_status_box_size_allocate (GtkWidget *widget, GtkAllocation *allocation); static gboolean gtk_gaim_status_box_expose_event (GtkWidget *widget, GdkEventExpose *event); static void gtk_gaim_status_box_redisplay_buddy_icon(GtkGaimStatusBox *status_box); static void gtk_gaim_status_box_forall (GtkContainer *container, gboolean include_internals, GtkCallback callback, gpointer callback_data); +static void gaim_gtk_status_box_popup(GtkGaimStatusBox *box); +static void gaim_gtk_status_box_popdown(GtkGaimStatusBox *box); static void do_colorshift (GdkPixbuf *dest, GdkPixbuf *src, int shift); static void icon_choose_cb(const char *filename, gpointer data); static void remove_buddy_icon_cb(GtkWidget *w, GtkGaimStatusBox *box); -static void (*combo_box_size_request)(GtkWidget *widget, GtkRequisition *requisition); -static void (*combo_box_size_allocate)(GtkWidget *widget, GtkAllocation *allocation); -static void (*combo_box_forall) (GtkContainer *container, gboolean include_internals, GtkCallback callback, gpointer callback_data); - enum { /** A GtkGaimStatusBoxItemType */ TYPE_COLUMN, @@ -123,7 +121,7 @@ PROP_ICON_SEL, }; -GtkComboBoxClass *parent_class = NULL; +GtkContainerClass *parent_class = NULL; static void gtk_gaim_status_box_class_init (GtkGaimStatusBoxClass *klass); static void gtk_gaim_status_box_init (GtkGaimStatusBox *status_box); @@ -149,7 +147,7 @@ NULL /* value_table */ }; - status_box_type = g_type_register_static(GTK_TYPE_COMBO_BOX, + status_box_type = g_type_register_static(GTK_TYPE_CONTAINER, "GtkGaimStatusBox", &status_box_info, 0); @@ -199,8 +197,13 @@ } if (status_no != -1) { + GtkTreePath *path; gtk_widget_set_sensitive(GTK_WIDGET(status_box), FALSE); - gtk_combo_box_set_active(GTK_COMBO_BOX(status_box), status_no); + path = gtk_tree_path_new_from_indices(status_no, -1); + if (status_box->active_row) + gtk_tree_row_reference_free(status_box->active_row); + status_box->active_row = gtk_tree_row_reference_new(status_box->dropdown_store, path); + gtk_tree_path_free(path); message = gaim_status_get_attr_string(newstatus, "message"); @@ -324,6 +327,9 @@ status_box->icon = gtk_image_new(); status_box->icon_box = gtk_event_box_new(); + gtk_widget_set_parent(status_box->icon_box, GTK_WIDGET(status_box)); + gtk_widget_show(status_box->icon_box); + if (status_box->account && !gaim_account_get_ui_bool(status_box->account, GAIM_GTK_UI, "use-global-buddyicon", TRUE)) { @@ -353,9 +359,7 @@ g_signal_connect(G_OBJECT(status_box->icon_box), "button-press-event", G_CALLBACK(icon_box_press_cb), status_box); gtk_container_add(GTK_CONTAINER(status_box->icon_box), status_box->icon); - - gtk_widget_show_all(status_box->icon_box); - gtk_widget_set_parent(status_box->icon_box, GTK_WIDGET(status_box)); + gtk_widget_show(status_box->icon); } static void @@ -446,27 +450,27 @@ G_OBJECT_CLASS(parent_class)->finalize(obj); } +static GType +gtk_gaim_status_box_child_type (GtkContainer *container) +{ + return GTK_TYPE_WIDGET; +} + static void gtk_gaim_status_box_class_init (GtkGaimStatusBoxClass *klass) { GObjectClass *object_class; - GtkComboBoxClass *combo_class; GtkWidgetClass *widget_class; GtkContainerClass *container_class = (GtkContainerClass*)klass; parent_class = g_type_class_peek_parent(klass); - combo_class = (GtkComboBoxClass*)klass; - combo_class->changed = gtk_gaim_status_box_changed; - widget_class = (GtkWidgetClass*)klass; - combo_box_size_request = widget_class->size_request; widget_class->size_request = gtk_gaim_status_box_size_request; - combo_box_size_allocate = widget_class->size_allocate; widget_class->size_allocate = gtk_gaim_status_box_size_allocate; widget_class->expose_event = gtk_gaim_status_box_expose_event; - combo_box_forall = container_class->forall; + container_class->child_type = gtk_gaim_status_box_child_type; container_class->forall = gtk_gaim_status_box_forall; container_class->remove = NULL; @@ -504,7 +508,6 @@ static void gtk_gaim_status_box_refresh(GtkGaimStatusBox *status_box) { - gboolean show_buddy_icons; GtkIconSize icon_size; GtkStyle *style; char aa_color[8]; @@ -515,13 +518,8 @@ gboolean account_status = FALSE; GaimAccount *acct = (status_box->token_status_account) ? status_box->token_status_account : status_box->account; - - show_buddy_icons = gaim_prefs_get_bool("/gaim/gtk/blist/show_buddy_icons"); - if (show_buddy_icons) - icon_size = gtk_icon_size_from_name(GAIM_ICON_SIZE_STATUS); - else - icon_size = gtk_icon_size_from_name(GAIM_ICON_SIZE_STATUS_SMALL); - + icon_size = gtk_icon_size_from_name(GAIM_ICON_SIZE_STATUS); + style = gtk_widget_get_style(GTK_WIDGET(status_box)); snprintf(aa_color, sizeof(aa_color), "#%02x%02x%02x", style->text_aa[GTK_STATE_NORMAL].red >> 8, @@ -542,7 +540,11 @@ gpointer data; /* Primary (get the status selected in the dropdown) */ - gtk_combo_box_get_active_iter(GTK_COMBO_BOX(status_box), &iter); + path = gtk_tree_row_reference_get_path(status_box->active_row); + if (!gtk_tree_model_get_iter (GTK_TREE_MODEL(status_box->dropdown_store), &iter, path)) + return; + gtk_tree_path_free(path); + gtk_tree_model_get(GTK_TREE_MODEL(status_box->dropdown_store), &iter, TYPE_COLUMN, &type, DATA_COLUMN, &data, @@ -595,11 +597,11 @@ if (account_status) pixbuf = gaim_gtk_create_prpl_icon_with_status(acct, gaim_status_get_type(gaim_account_get_active_status(acct)), - show_buddy_icons ? 1.0 : 0.5); + 0.5); else pixbuf = gaim_gtk_create_gaim_icon_with_status( gaim_savedstatus_get_type(saved_status), - show_buddy_icons ? 1.0 : 0.5); + 0.5); if (!gaim_savedstatus_is_transient(saved_status)) { @@ -622,15 +624,12 @@ } if (status_box->account != NULL) { - text = g_strdup_printf("%s%s<span size=\"smaller\" color=\"%s\">%s</span>", - gaim_account_get_username(status_box->account), - show_buddy_icons ? "\n" : " - ", aa_color, - secondary ? secondary : primary); + text = g_strdup_printf("%s - <span size=\"smaller\" color=\"%s\">%s</span>", + gaim_account_get_username(status_box->account), + aa_color, secondary ? secondary : primary); } else if (secondary != NULL) { - char *separator; - separator = show_buddy_icons ? "\n" : " - "; - text = g_strdup_printf("%s<span size=\"smaller\" color=\"%s\">%s%s</span>", - primary, aa_color, separator, secondary); + text = g_strdup_printf("%s<span size=\"smaller\" color=\"%s\"> - %s</span>", + primary, aa_color, secondary); } else { text = g_strdup(primary); } @@ -716,8 +715,14 @@ (primitive == GAIM_STATUS_INVISIBLE) || (primitive == GAIM_STATUS_OFFLINE)) && (!gaim_savedstatus_has_substatuses(saved_status))) { + GtkTreePath *path; index = get_statusbox_index(status_box, saved_status); - gtk_combo_box_set_active(GTK_COMBO_BOX(status_box), index); + path = gtk_tree_path_new_from_indices(index, -1); + if (status_box->active_row) + gtk_tree_row_reference_free(status_box->active_row); + status_box->active_row = gtk_tree_row_reference_new(status_box->dropdown_store, path); + gtk_tree_path_free(path); + } else { @@ -726,7 +731,9 @@ gpointer data; /* Unset the active item */ - gtk_combo_box_set_active(GTK_COMBO_BOX(status_box), -1); + if (status_box->active_row) + gtk_tree_row_reference_free(status_box->active_row); + status_box->active_row = NULL; /* If this saved status is in the list store, then set it as the active item */ if (gtk_tree_model_get_iter_first(GTK_TREE_MODEL(status_box->dropdown_store), &iter)) @@ -754,7 +761,8 @@ || !strcmp(name, acct_status_name)) { /* Found! */ - gtk_combo_box_set_active_iter(GTK_COMBO_BOX(status_box), &iter); + // gtk_combo_box_set_active_iter(GTK_COMBO_BOX(status_box), &iter); + g_free(name); break; } @@ -764,7 +772,7 @@ (GPOINTER_TO_INT(data) == gaim_savedstatus_get_creation_time(saved_status))) { /* Found! */ - gtk_combo_box_set_active_iter(GTK_COMBO_BOX(status_box), &iter); + // gtk_combo_box_set_active_iter(GTK_COMBO_BOX(status_box), &iter); break; } } @@ -804,8 +812,7 @@ static void add_popular_statuses(GtkGaimStatusBox *statusbox) { - gboolean show_buddy_icons; - GtkIconSize icon_size; + GtkIconSize icon_size; GList *list, *cur; GdkPixbuf *pixbuf, *emblem; int width, height; @@ -815,11 +822,7 @@ /* Odd... oh well, nothing we can do about it. */ return; - show_buddy_icons = gaim_prefs_get_bool("/gaim/gtk/blist/show_buddy_icons"); - if (show_buddy_icons) - icon_size = gtk_icon_size_from_name(GAIM_ICON_SIZE_STATUS); - else - icon_size = gtk_icon_size_from_name(GAIM_ICON_SIZE_STATUS_SMALL); + icon_size = gtk_icon_size_from_name(GAIM_ICON_SIZE_STATUS_SMALL); gtk_gaim_status_box_add_separator(statusbox); @@ -832,7 +835,7 @@ /* Get an appropriate status icon */ pixbuf = gaim_gtk_create_gaim_icon_with_status( gaim_savedstatus_get_type(saved), - show_buddy_icons ? 1.0 : 0.5); + 0.5); if (gaim_savedstatus_is_transient(saved)) { @@ -927,7 +930,7 @@ } static void -add_account_statuses(GtkGaimStatusBox *status_box, GaimAccount *account, gboolean show_buddy_icons) +add_account_statuses(GtkGaimStatusBox *status_box, GaimAccount *account) { /* Per-account */ const GList *l; @@ -940,8 +943,7 @@ if (!gaim_status_type_is_user_settable(status_type)) continue; - tmp = gaim_gtk_create_prpl_icon_with_status(account, status_type, - show_buddy_icons ? 1.0 : 0.5); + tmp = gaim_gtk_create_prpl_icon_with_status(account, status_type, 0.5); gtk_gaim_status_box_add(GTK_GAIM_STATUS_BOX(status_box), GTK_GAIM_STATUS_BOX_TYPE_PRIMITIVE, tmp, gaim_status_type_get_name(status_type), @@ -950,24 +952,18 @@ if (tmp != NULL) g_object_unref(tmp); } - gtk_combo_box_set_model(GTK_COMBO_BOX(status_box), GTK_TREE_MODEL(status_box->dropdown_store)); } static void gtk_gaim_status_box_regenerate(GtkGaimStatusBox *status_box) { - gboolean show_buddy_icons; GdkPixbuf *pixbuf, *pixbuf2, *pixbuf3, *pixbuf4; GtkIconSize icon_size; - show_buddy_icons = gaim_prefs_get_bool("/gaim/gtk/blist/show_buddy_icons"); - if (show_buddy_icons) - icon_size = gtk_icon_size_from_name(GAIM_ICON_SIZE_STATUS); - else - icon_size = gtk_icon_size_from_name(GAIM_ICON_SIZE_STATUS_SMALL); + icon_size = gtk_icon_size_from_name(GAIM_ICON_SIZE_STATUS_SMALL); /* Unset the model while clearing it */ - gtk_combo_box_set_model(GTK_COMBO_BOX(status_box), NULL); + gtk_tree_view_set_model(GTK_TREE_VIEW(status_box->tree_view), NULL); gtk_list_store_clear(status_box->dropdown_store); /* Don't set the model until the new statuses have been added to the box. * What is presumably a bug in Gtk < 2.4 causes things to get all confused @@ -982,7 +978,7 @@ * If so, display them instead of our global list. */ if (status_box->token_status_account) { - add_account_statuses(status_box, status_box->token_status_account, show_buddy_icons); + add_account_statuses(status_box, status_box->token_status_account); } else { /* Global */ pixbuf2 = gtk_widget_render_icon (GTK_WIDGET(status_box->vbox), GAIM_STOCK_STATUS_AWAY, @@ -1009,19 +1005,19 @@ gtk_gaim_status_box_add(GTK_GAIM_STATUS_BOX(status_box), GTK_GAIM_STATUS_BOX_TYPE_SAVED, pixbuf, _("Saved..."), NULL, NULL); if (pixbuf) g_object_unref(G_OBJECT(pixbuf)); - gtk_combo_box_set_model(GTK_COMBO_BOX(status_box), GTK_TREE_MODEL(status_box->dropdown_store)); status_menu_refresh_iter(status_box); } else { - add_account_statuses(status_box, status_box->account, show_buddy_icons); + add_account_statuses(status_box, status_box->account); update_to_reflect_account_status(status_box, status_box->account, gaim_account_get_active_status(status_box->account)); } + gtk_tree_view_set_model(GTK_TREE_VIEW(status_box->tree_view), status_box->dropdown_store); } static gboolean combo_box_scroll_event_cb(GtkWidget *w, GdkEventScroll *event, GtkIMHtml *imhtml) { - gtk_combo_box_popup(GTK_COMBO_BOX(w)); + gaim_gtk_status_box_popup(GTK_GAIM_STATUS_BOX(w)); return TRUE; } @@ -1088,16 +1084,10 @@ cache_pixbufs(GtkGaimStatusBox *status_box) { GtkIconSize icon_size; + + g_object_set(G_OBJECT(status_box->icon_rend), "xpad", 3, NULL); + icon_size = gtk_icon_size_from_name(GAIM_ICON_SIZE_STATUS_SMALL_TWO_LINE); - if (gaim_prefs_get_bool("/gaim/gtk/blist/show_buddy_icons")) - { - g_object_set(G_OBJECT(status_box->icon_rend), "xpad", 6, NULL); - icon_size = gtk_icon_size_from_name(GAIM_ICON_SIZE_STATUS_TWO_LINE); - } else { - g_object_set(G_OBJECT(status_box->icon_rend), "xpad", 3, NULL); - icon_size = gtk_icon_size_from_name(GAIM_ICON_SIZE_STATUS_SMALL_TWO_LINE); - } - if (status_box->connecting_pixbufs[0] != NULL) gdk_pixbuf_unref(status_box->connecting_pixbufs[0]); if (status_box->connecting_pixbufs[1] != NULL) @@ -1157,16 +1147,6 @@ } static void -buddy_list_details_pref_changed_cb(const char *name, GaimPrefType type, - gconstpointer val, gpointer data) -{ - GtkGaimStatusBox *status_box = (GtkGaimStatusBox *)data; - - cache_pixbufs(status_box); - gtk_gaim_status_box_regenerate(status_box); -} - -static void spellcheck_prefs_cb(const char *name, GaimPrefType type, gconstpointer value, gpointer data) { @@ -1190,7 +1170,6 @@ if (event->button != 1) return FALSE; - gtk_combo_box_popdown(GTK_COMBO_BOX(box)); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(box->toggle_button), FALSE); if (!box->imhtml_visible) g_signal_emit_by_name(G_OBJECT(box), "changed", NULL, NULL); @@ -1209,10 +1188,101 @@ #endif static void +gtk_gaim_status_box_list_position (GtkGaimStatusBox *status_box, int *x, int *y, int *width, int *height) +{ + GdkScreen *screen; + gint monitor_num; + GdkRectangle monitor; + GtkRequisition popup_req; + GtkPolicyType hpolicy, vpolicy; + + gdk_window_get_origin (GTK_WIDGET(status_box)->window, x, y); + + *x += GTK_WIDGET(status_box)->allocation.x; + *y += GTK_WIDGET(status_box)->allocation.y; + + *width = GTK_WIDGET(status_box)->allocation.width; + + hpolicy = vpolicy = GTK_POLICY_NEVER; + gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (status_box->scrolled_window), + hpolicy, vpolicy); + gtk_widget_size_request (status_box->popup_frame, &popup_req); + + if (popup_req.width > *width) + { + hpolicy = GTK_POLICY_ALWAYS; + gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (status_box->scrolled_window), + hpolicy, vpolicy); + gtk_widget_size_request (status_box->popup_frame, &popup_req); + } + + *height = popup_req.height; + + screen = gtk_widget_get_screen (GTK_WIDGET (status_box)); + monitor_num = gdk_screen_get_monitor_at_window (screen, + GTK_WIDGET (status_box)->window); + gdk_screen_get_monitor_geometry (screen, monitor_num, &monitor); + + if (*x < monitor.x) + *x = monitor.x; + else if (*x + *width > monitor.x + monitor.width) + *x = monitor.x + monitor.width - *width; + + if (*y + GTK_WIDGET(status_box)->allocation.height + *height <= monitor.y + monitor.height) + *y += GTK_WIDGET(status_box)->allocation.height; + else if (*y - *height >= monitor.y) + *y -= *height; + else if (monitor.y + monitor.height - (*y + GTK_WIDGET(status_box)->allocation.height) > *y - monitor.y) + { + *y += GTK_WIDGET(status_box)->allocation.height; + *height = monitor.y + monitor.height - *y; + } + else + { + *height = *y - monitor.y; + *y = monitor.y; + } + + if (popup_req.height > *height) + { + vpolicy = GTK_POLICY_ALWAYS; + + gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (status_box->scrolled_window), + hpolicy, vpolicy); + } +} + +static void +gaim_gtk_status_box_popup(GtkGaimStatusBox *box) +{ + int width, height, x, y; + gtk_gaim_status_box_list_position (box, &x, &y, &width, &height); + + gtk_widget_set_size_request (box->popup_window, width, height); + gtk_window_move (GTK_WINDOW (box->popup_window), x, y); + gtk_widget_show(box->popup_window); + box->popup_in_progress = TRUE; +} + +static void +gaim_gtk_status_box_popdown(GtkGaimStatusBox *box) { + gtk_widget_hide(box->popup_window); + box->popup_in_progress = FALSE; + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (box->toggle_button), + FALSE); + +} + + +static void toggled_cb(GtkWidget *widget, GtkGaimStatusBox *box) { - gtk_combo_box_popup(GTK_COMBO_BOX(box)); - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(box->toggle_button), FALSE); + if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget))) { + if (!box->popup_in_progress) + gaim_gtk_status_box_popup (box); + } else { + gaim_gtk_status_box_popdown(box); + } } static void @@ -1287,18 +1357,45 @@ static void update_buddyicon_cb(const char *name, GaimPrefType type, - gconstpointer value, gpointer data) + gconstpointer value, gpointer data) { buddy_icon_set_cb(value, (GtkGaimStatusBox*) data); } +static gboolean +treeview_button_release_cb(GtkWidget *widget, GdkEventButton *event, GtkGaimStatusBox *status_box) +{ + GtkTreePath *path = NULL; + int ret = gtk_tree_view_get_path_at_pos (GTK_TREE_VIEW (status_box->tree_view), + event->x, event->y, + &path, + NULL, NULL, NULL); + + if (!ret) + return TRUE; /* clicked outside window? */ + + if (status_box->active_row) + gtk_tree_row_reference_free(status_box->active_row); + + status_box->active_row = gtk_tree_row_reference_new(GTK_TREE_MODEL(status_box->dropdown_store), path); + gtk_tree_path_free (path); + + gaim_gtk_status_box_popdown (status_box); + gtk_gaim_status_box_changed(status_box); + + return TRUE; +} + static void gtk_gaim_status_box_init (GtkGaimStatusBox *status_box) { GtkCellRenderer *text_rend; GtkCellRenderer *icon_rend; GtkTextBuffer *buffer; + GtkWidget *toplevel; + GtkTreeSelection *sel; + GTK_WIDGET_SET_FLAGS (status_box, GTK_NO_WINDOW); status_box->imhtml_visible = FALSE; status_box->network_available = gaim_network_is_available(); status_box->connecting = FALSE; @@ -1308,12 +1405,11 @@ status_box->cell_view = gtk_cell_view_new(); status_box->vsep = gtk_vseparator_new(); status_box->arrow = gtk_arrow_new (GTK_ARROW_DOWN, GTK_SHADOW_NONE); - + status_box->store = gtk_list_store_new(NUM_COLUMNS, G_TYPE_INT, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_POINTER); status_box->dropdown_store = gtk_list_store_new(NUM_COLUMNS, G_TYPE_INT, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_POINTER); - gtk_combo_box_set_model(GTK_COMBO_BOX(status_box), GTK_TREE_MODEL(status_box->dropdown_store)); +; gtk_cell_view_set_model(GTK_CELL_VIEW(status_box->cell_view), GTK_TREE_MODEL(status_box->store)); - gtk_combo_box_set_wrap_width(GTK_COMBO_BOX(status_box), 0); gtk_list_store_append(status_box->store, &(status_box->iter)); gtk_container_add(GTK_CONTAINER(status_box->toggle_button), status_box->hbox); @@ -1327,10 +1423,59 @@ text_rend = gtk_cell_renderer_text_new(); icon_rend = gtk_cell_renderer_pixbuf_new(); - gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(status_box), icon_rend, FALSE); - gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(status_box), text_rend, TRUE); - gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(status_box), icon_rend, "pixbuf", ICON_COLUMN, NULL); - gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(status_box), text_rend, "markup", TEXT_COLUMN, NULL); + + + status_box->popup_window = gtk_window_new (GTK_WINDOW_POPUP); + + toplevel = gtk_widget_get_toplevel (GTK_WIDGET (status_box)); + if (GTK_IS_WINDOW (toplevel)) { + gtk_window_set_transient_for (GTK_WINDOW (status_box->popup_window), + GTK_WINDOW (toplevel)); + } + + gtk_window_set_resizable (GTK_WINDOW (status_box->popup_window), FALSE); + gtk_window_set_screen (GTK_WINDOW (status_box->popup_window), + gtk_widget_get_screen (GTK_WIDGET (status_box))); + status_box->popup_frame = gtk_frame_new (NULL); + gtk_frame_set_shadow_type (GTK_FRAME (status_box->popup_frame), + GTK_SHADOW_ETCHED_IN); + gtk_container_add (GTK_CONTAINER (status_box->popup_window), + status_box->popup_frame); + + gtk_widget_show (status_box->popup_frame); + + status_box->scrolled_window = gtk_scrolled_window_new (NULL, NULL); + + gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (status_box->scrolled_window), + GTK_POLICY_NEVER, + GTK_POLICY_NEVER); + gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (status_box->scrolled_window), + GTK_SHADOW_NONE); + + gtk_widget_show (status_box->scrolled_window); + + gtk_container_add (GTK_CONTAINER (status_box->popup_frame), + status_box->scrolled_window); + + status_box->tree_view = gtk_tree_view_new (); + sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (status_box->tree_view)); + gtk_tree_selection_set_mode (sel, GTK_SELECTION_BROWSE); + gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (status_box->tree_view), + FALSE); + gtk_tree_view_set_hover_selection (GTK_TREE_VIEW (status_box->tree_view), + TRUE); + gtk_tree_view_set_model (GTK_TREE_VIEW (status_box->tree_view), + status_box->dropdown_store); + status_box->column = gtk_tree_view_column_new (); + gtk_tree_view_append_column (GTK_TREE_VIEW (status_box->tree_view), + status_box->column); + gtk_tree_view_column_pack_start(status_box->column, icon_rend, FALSE); + gtk_tree_view_column_pack_start(status_box->column, text_rend, TRUE); + gtk_tree_view_column_set_attributes(GTK_CELL_LAYOUT(status_box->column), icon_rend, "pixbuf", ICON_COLUMN, NULL); + gtk_tree_view_column_set_attributes(GTK_CELL_LAYOUT(status_box->column), text_rend, "markup", TEXT_COLUMN, NULL); + gtk_container_add(GTK_CONTAINER(status_box->scrolled_window), status_box->tree_view); + gtk_widget_show(status_box->tree_view); + #if GTK_CHECK_VERSION(2, 6, 0) g_object_set(text_rend, "ellipsize", PANGO_ELLIPSIZE_END, NULL); #endif @@ -1370,17 +1515,19 @@ gaim_gtk_setup_gtkspell(GTK_TEXT_VIEW(status_box->imhtml)); #endif gtk_widget_set_parent(status_box->vbox, GTK_WIDGET(status_box)); + gtk_widget_show_all(status_box->vbox); + gtk_widget_set_parent(status_box->toggle_button, GTK_WIDGET(status_box)); - GTK_BIN(status_box)->child = status_box->toggle_button; gtk_box_pack_start(GTK_BOX(status_box->vbox), status_box->sw, TRUE, TRUE, 0); g_signal_connect(G_OBJECT(status_box), "scroll_event", G_CALLBACK(combo_box_scroll_event_cb), NULL); g_signal_connect(G_OBJECT(status_box->imhtml), "scroll_event", G_CALLBACK(imhtml_scroll_event_cb), status_box->imhtml); + g_signal_connect(G_OBJECT(status_box->tree_view), "button_release_event", G_CALLBACK(treeview_button_release_cb), status_box); #if GTK_CHECK_VERSION(2,6,0) - gtk_combo_box_set_row_separator_func(GTK_COMBO_BOX(status_box), dropdown_store_row_separator_func, NULL, NULL); + gtk_tree_view_set_row_separator_func(GTK_TREE_VIEW(status_box->tree_view), dropdown_store_row_separator_func, NULL, NULL); #endif status_box->token_status_account = check_active_accounts_for_identical_statuses(); @@ -1402,8 +1549,6 @@ GAIM_CALLBACK(account_status_changed_cb), status_box); - gaim_prefs_connect_callback(status_box, "/gaim/gtk/blist/show_buddy_icons", - buddy_list_details_pref_changed_cb, status_box); gaim_prefs_connect_callback(status_box, "/gaim/gtk/conversations/spellcheck", spellcheck_prefs_cb, status_box); gaim_prefs_connect_callback(status_box, "/gaim/gtk/accounts/buddyicon", @@ -1415,17 +1560,20 @@ GtkRequisition *requisition) { GtkRequisition box_req; - combo_box_size_request(widget, requisition); - requisition->height += 3; + gint border_width = GTK_CONTAINER (widget)->border_width; + gtk_widget_size_request(GTK_GAIM_STATUS_BOX(widget)->toggle_button, requisition); + + /* Make this icon the same size as other buddy icons in the list; unless it already wants to be bigger */ + if ( gaim_prefs_get_bool("/gaim/gtk/blist/show_buddy_icons")) + requisition->height = MAX(requisition->height, 30 + (border_width*2)); + /* If the gtkimhtml is visible, then add some additional padding */ gtk_widget_size_request(GTK_GAIM_STATUS_BOX(widget)->vbox, &box_req); if (box_req.height > 1) requisition->height += box_req.height + 3; requisition->width = 1; - - } /* From gnome-panel */ @@ -1477,8 +1625,12 @@ GtkAllocation parent_alc, box_alc, icon_alc; gint border_width = GTK_CONTAINER (widget)->border_width; - combo_box_size_request(widget, &req); + gtk_widget_size_request(status_box->toggle_button, &req); + /* Make this icon the same size as other buddy icons in the list; unless it already wants to be bigger */ + if ( gaim_prefs_get_bool("/gaim/gtk/blist/show_buddy_icons")) + req.height = MAX(req.height, 30 + (border_width*2)); + box_alc = *allocation; box_alc.width -= (border_width * 2); @@ -1488,7 +1640,7 @@ gtk_widget_size_allocate((GTK_GAIM_STATUS_BOX(widget))->vbox, &box_alc); parent_alc = *allocation; - parent_alc.height = MAX(1,req.height - (border_width )); + parent_alc.height = MAX(1,req.height - (border_width *2)); parent_alc.width -= (border_width * 2); parent_alc.x += border_width; parent_alc.y += border_width; @@ -1498,7 +1650,7 @@ GtkTextDirection dir = gtk_widget_get_direction(widget); parent_alc.width -= (parent_alc.height + border_width); icon_alc = *allocation; - icon_alc.height = MAX(1,req.height) - (border_width); + icon_alc.height = MAX(1,req.height) - (border_width*2); icon_alc.width = icon_alc.height; if (dir == GTK_TEXT_DIR_RTL) { icon_alc.x = parent_alc.x; @@ -1516,7 +1668,6 @@ gtk_widget_size_allocate(status_box->icon_box, &icon_alc); } - combo_box_size_allocate(widget, &parent_alc); gtk_widget_size_allocate(status_box->toggle_button, &parent_alc); widget->allocation = *allocation; } @@ -1543,14 +1694,12 @@ if (include_internals) { - (* callback) (status_box->vbox, callback_data); + (* callback) (status_box->vbox, callback_data); (* callback) (status_box->toggle_button, callback_data); (* callback) (status_box->arrow, callback_data); if (status_box->icon_box) (* callback) (status_box->icon_box, callback_data); } - - combo_box_forall(container, include_internals, callback, callback_data); } GtkWidget * @@ -1599,12 +1748,10 @@ } else { - gboolean show_buddy_icons; GtkStyle *style; char aa_color[8]; gchar *escaped_title, *escaped_desc; - show_buddy_icons = gaim_prefs_get_bool("/gaim/gtk/blist/show_buddy_icons"); style = gtk_widget_get_style(GTK_WIDGET(status_box)); snprintf(aa_color, sizeof(aa_color), "#%02x%02x%02x", style->text_aa[GTK_STATE_NORMAL].red >> 8, @@ -1613,10 +1760,9 @@ escaped_title = g_markup_escape_text(title, -1); escaped_desc = g_markup_escape_text(desc, -1); - text = g_strdup_printf("%s%s<span color=\"%s\" size=\"smaller\">%s</span>", + text = g_strdup_printf("%s - <span color=\"%s\" size=\"smaller\">%s</span>", escaped_title, - show_buddy_icons ? "\n" : " - ", - aa_color, escaped_desc); + aa_color, escaped_desc); g_free(escaped_title); g_free(escaped_desc); } @@ -1759,12 +1905,15 @@ gpointer data; gchar *title; GtkTreeIter iter; + GtkTreePath *path; char *message; GaimSavedStatus *saved_status = NULL; gboolean changed = TRUE; - - if (!gtk_combo_box_get_active_iter(GTK_COMBO_BOX(status_box), &iter)) + + path = gtk_tree_row_reference_get_path(status_box->active_row); + if (!gtk_tree_model_get_iter (GTK_TREE_MODEL(status_box->dropdown_store), &iter, path)) return; + gtk_tree_path_free(path); gtk_tree_model_get(GTK_TREE_MODEL(status_box->dropdown_store), &iter, TYPE_COLUMN, &type, @@ -1808,11 +1957,14 @@ gint active; GaimStatus *status; const char *id = NULL; + GtkTreePath *path = gtk_tree_row_reference_get_path(status_box->active_row); + active = gtk_tree_path_get_indices(path)[0]; + + gtk_tree_path_free(path); status = gaim_account_get_active_status(status_box->token_status_account); - g_object_get(G_OBJECT(status_box), "active", &active, NULL); - acct_status_type = find_status_type_by_index(status_box->token_status_account, active); + acct_status_type = find_status_type_by_index(status_box->token_status_account, active); id = gaim_status_type_get_id(acct_status_type); if (strncmp(id, gaim_status_get_id(status), strlen(id)) == 0) @@ -1998,18 +2150,19 @@ gtk_gaim_status_box_refresh(status_box); } -static void gtk_gaim_status_box_changed(GtkComboBox *box) +static void gtk_gaim_status_box_changed(GtkGaimStatusBox *status_box) { - GtkGaimStatusBox *status_box; + GtkTreePath *path = gtk_tree_row_reference_get_path(status_box->active_row); GtkTreeIter iter; GtkGaimStatusBoxItemType type; gpointer data; GList *accounts = NULL, *node; - status_box = GTK_GAIM_STATUS_BOX(box); - - if (!gtk_combo_box_get_active_iter(GTK_COMBO_BOX(status_box), &iter)) + + if (!gtk_tree_model_get_iter (GTK_TREE_MODEL(status_box->dropdown_store), &iter, path)) return; + gtk_tree_path_free(path); + gtk_tree_model_get(GTK_TREE_MODEL(status_box->dropdown_store), &iter, TYPE_COLUMN, &type, DATA_COLUMN, &data, Modified: trunk/gtk/gtkstatusbox.h =================================================================== --- trunk/gtk/gtkstatusbox.h 2006-12-01 04:38:54 UTC (rev 17863) +++ trunk/gtk/gtkstatusbox.h 2006-12-01 05:01:51 UTC (rev 17864) @@ -65,7 +65,7 @@ struct _GtkGaimStatusBox { - GtkComboBox parent_instance; + GtkContainer parent_instance; /** * This GtkListStore contains only one row--the currently selected status. @@ -128,11 +128,20 @@ GtkWidget *toggle_button; GtkWidget *vsep; GtkWidget *arrow; + + GtkWidget *popup_window; + GtkWidget *popup_frame; + GtkWidget *scrolled_window; + GtkWidget *cell_view_frame; + GtkTreeViewColumn *column; + GtkWidget *tree_view; + gboolean popup_in_progress; + GtkTreeRowReference *active_row; }; struct _GtkGaimStatusBoxClass { - GtkComboBoxClass parent_class; + GtkContainerClass parent_class; /* signals */ void (* changed) (GtkComboBox *combo_box); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <the...@us...> - 2006-12-01 04:40:15
|
Revision: 17863 http://svn.sourceforge.net/gaim/?rev=17863&view=rev Author: thekingant Date: 2006-11-30 20:38:54 -0800 (Thu, 30 Nov 2006) Log Message: ----------- Surely this is what was intended? Get rid of an assertion failure when adding a new account. Modified Paths: -------------- trunk/gtk/gtkaccount.c Modified: trunk/gtk/gtkaccount.c =================================================================== --- trunk/gtk/gtkaccount.c 2006-12-01 04:27:36 UTC (rev 17862) +++ trunk/gtk/gtkaccount.c 2006-12-01 04:38:54 UTC (rev 17863) @@ -1155,7 +1155,7 @@ else if (gaim_prefs_get_string("/gaim/gtk/accounts/buddyicon") && icon_change) { const char *filename = gaim_prefs_get_string("/gaim/gtk/accounts/buddyicon"); - char *icon = gaim_gtk_convert_buddy_icon(dialog->plugin, gaim_prefs_get_string(filename)); + char *icon = gaim_gtk_convert_buddy_icon(dialog->plugin, filename); gaim_account_set_buddy_icon_path(account, filename); gaim_account_set_buddy_icon(account, icon); g_free(icon); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <the...@us...> - 2006-12-01 04:28:28
|
Revision: 17862 http://svn.sourceforge.net/gaim/?rev=17862&view=rev Author: thekingant Date: 2006-11-30 20:27:36 -0800 (Thu, 30 Nov 2006) Log Message: ----------- Don't attempt to check for new mail for screen names in the form of email addresses. This fixes sf bug #1595188. It mail checking currently works for @mac.com screen names then this will break it (unfortunate side-effect). Modified Paths: -------------- trunk/libgaim/protocols/oscar/oscar.c Modified: trunk/libgaim/protocols/oscar/oscar.c =================================================================== --- trunk/libgaim/protocols/oscar/oscar.c 2006-12-01 04:17:15 UTC (rev 17861) +++ trunk/libgaim/protocols/oscar/oscar.c 2006-12-01 04:27:36 UTC (rev 17862) @@ -3527,7 +3527,17 @@ } aim_reqservice(od, SNAC_FAMILY_CHATNAV); - if (od->authinfo->email != NULL) + + /* + * The "if" statement here is a pathetic attempt to not attempt to + * connect to the alerts servce (aka email notification) if this + * screen name does not support it. I think mail notification + * works for @mac.com accounts but does not work for the newer + * @anythingelse.com accounts. If that's true then this change + * breaks mail notification for @mac.com accounts, but it gets rid + * of an annoying error at signon for @anythingelse.com accounts. + */ + if ((od->authinfo->email != NULL) && ((strchr(gc->account->username, '@') == NULL))) aim_reqservice(od, SNAC_FAMILY_ALERT); return 1; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dat...@us...> - 2006-12-01 04:18:45
|
Revision: 17861 http://svn.sourceforge.net/gaim/?rev=17861&view=rev Author: datallah Date: 2006-11-30 20:17:15 -0800 (Thu, 30 Nov 2006) Log Message: ----------- link to the newer NSS/NSPR versions that wingaim will be using Modified Paths: -------------- web/htdocs/win32/build.php Modified: web/htdocs/win32/build.php =================================================================== --- web/htdocs/win32/build.php 2006-12-01 04:16:34 UTC (rev 17860) +++ web/htdocs/win32/build.php 2006-12-01 04:17:15 UTC (rev 17861) @@ -82,13 +82,13 @@ </dd> <dt>Mozilla NSS</dt> -<dd>Download and unzip the following under <code>~/win32-dev</code> (make sure you <code>chmod 755</code> all the unziped binaries): +<dd>Download and unzip the following under <code>~/win32-dev</code> (make sure you <code>chmod 755</code> all the unzipped binaries): <ul> <li> -<a href="ftp://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/NSS_3_9_RTM/WIN954.0_OPT.OBJ/nss-3.9.zip">Network Security Services (NSS)</a> +<a href="ftp://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/NSS_3_11_4_RTM/msvc6.0/WIN954.0_OPT.OBJ/nss-3.11.4.zip">Network Security Services (NSS)</a> </li> <li> -<a href="ftp://ftp.mozilla.org/pub/mozilla.org/nspr/releases/v4.4.1/WIN954.0_OPT.OBJ/nspr-4.4.1.zip">Netscape Portable Runtime (NSPR)</a> +<a href="ftp://ftp.mozilla.org/pub/mozilla.org/nspr/releases/v4.6.4/msvc6.0/WIN954.0_OPT.OBJ/nspr-4.6.4.zip">Netscape Portable Runtime (NSPR)</a> </li> </ul> </dd> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dat...@us...> - 2006-12-01 04:17:46
|
Revision: 17860 http://svn.sourceforge.net/gaim/?rev=17860&view=rev Author: datallah Date: 2006-11-30 20:16:34 -0800 (Thu, 30 Nov 2006) Log Message: ----------- Upgrade NSS/NSPR for wingaim - we were using relatively old versions. There have been some occasional crashes that may have been caused by some old bugs. I've been using this for a week or so and haven't had any problems. Modified Paths: -------------- trunk/gaim-installer.nsi trunk/libgaim/plugins/ssl/Makefile.mingw trunk/libgaim/win32/global.mak Modified: trunk/gaim-installer.nsi =================================================================== --- trunk/gaim-installer.nsi 2006-11-30 17:45:28 UTC (rev 17859) +++ trunk/gaim-installer.nsi 2006-12-01 04:16:34 UTC (rev 17860) @@ -697,6 +697,7 @@ Delete "$INSTDIR\sounds\gaim\send.wav" RMDir "$INSTDIR\sounds\gaim" RMDir "$INSTDIR\sounds" + Delete "$INSTDIR\freebl3.dll" Delete "$INSTDIR\gaim.exe" Delete "$INSTDIR\gtkgaim.dll" Delete "$INSTDIR\idletrack.dll" Modified: trunk/libgaim/plugins/ssl/Makefile.mingw =================================================================== --- trunk/libgaim/plugins/ssl/Makefile.mingw 2006-11-30 17:45:28 UTC (rev 17859) +++ trunk/libgaim/plugins/ssl/Makefile.mingw 2006-12-01 04:16:34 UTC (rev 17860) @@ -13,7 +13,9 @@ TARGET = ssl TARGET_NSS = ssl-nss -NEEDED_DLLS = $(NSS_TOP)/lib/nss3.dll \ +NEEDED_DLLS = \ + $(NSS_TOP)/lib/freebl3.dll \ + $(NSS_TOP)/lib/nss3.dll \ $(NSS_TOP)/lib/nssckbi.dll \ $(NSS_TOP)/lib/softokn3.dll \ $(NSS_TOP)/lib/ssl3.dll \ Modified: trunk/libgaim/win32/global.mak =================================================================== --- trunk/libgaim/win32/global.mak 2006-11-30 17:45:28 UTC (rev 17859) +++ trunk/libgaim/win32/global.mak 2006-12-01 04:16:34 UTC (rev 17860) @@ -14,8 +14,8 @@ HOWL_TOP := $(WIN32_DEV_TOP)/howl-1.0.0 LIBXML2_TOP := $(WIN32_DEV_TOP)/libxml2 MEANWHILE_TOP := $(WIN32_DEV_TOP)/meanwhile-1.0.2 -NSPR_TOP := $(WIN32_DEV_TOP)/nspr-4.4.1 -NSS_TOP := $(WIN32_DEV_TOP)/nss-3.9 +NSPR_TOP := $(WIN32_DEV_TOP)/nspr-4.6.4 +NSS_TOP := $(WIN32_DEV_TOP)/nss-3.11.4 PERL_LIB_TOP := $(WIN32_DEV_TOP)/perl58 SILC_TOOLKIT := $(WIN32_DEV_TOP)/silc-toolkit-1.0.2 TCL_LIB_TOP := $(WIN32_DEV_TOP)/tcl-8.4.5 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dat...@us...> - 2006-11-30 17:45:50
|
Revision: 17859 http://svn.sourceforge.net/gaim/?rev=17859&view=rev Author: datallah Date: 2006-11-30 09:45:28 -0800 (Thu, 30 Nov 2006) Log Message: ----------- Fix win32 build for buddy icon changes. Also a couple leak fixes. There really isn't that much actually changed, but also I did some whitespace cleanup at the same time. Modified Paths: -------------- trunk/libgaim/protocols/qq/buddy_info.c trunk/libgaim/protocols/qq/qq.c trunk/libgaim/protocols/qq/qq.h trunk/libgaim/protocols/qq/utils.c Modified: trunk/libgaim/protocols/qq/buddy_info.c =================================================================== --- trunk/libgaim/protocols/qq/buddy_info.c 2006-11-30 16:50:14 UTC (rev 17858) +++ trunk/libgaim/protocols/qq/buddy_info.c 2006-11-30 17:45:28 UTC (rev 17859) @@ -29,7 +29,7 @@ #include "utils.h" #include "packet_parse.h" -#include "buddy_info.h" +#include "buddy_info.h" #include "char_conv.h" #include "crypt.h" #include "header_info.h" @@ -89,16 +89,16 @@ /* There is no user id stored in the reply packet for information query * we have to manually store the query, so that we know the query source */ typedef struct _qq_info_query { - guint32 uid; - gboolean show_window; - gboolean modify_info; + guint32 uid; + gboolean show_window; + gboolean modify_info; } qq_info_query; /* We get an info packet on ourselves before we modify our information. * Even though not all of the information is modifiable, it still * all needs to be there when we send out the modify info packet */ typedef struct _modify_info_data { - GaimConnection *gc; + GaimConnection *gc; contact_info *info; } modify_info_data; @@ -110,7 +110,7 @@ len = strlen(value); if (len > 3 || len == 0) return -1; for (i = 0; i < len; i++) { - if (!g_ascii_isdigit(value[i])) + if (!g_ascii_isdigit(value[i])) return -1; } i = strtol(value, NULL, 10); @@ -153,11 +153,11 @@ } } -static void append_field_value(GString *info_text, const gchar *field, +static void append_field_value(GString *info_text, const gchar *field, const gchar *title, const gchar **choice, gint choice_size) { gchar *value = field_value(field, choice, choice_size); - + if (value != NULL) { g_string_append_printf(info_text, "<br /><b>%s:</b> %s", title, value); g_free(value); @@ -263,7 +263,7 @@ /* traverse backwards so we get the most recent info_query */ for (ql = g_list_last(qd->info_query); ql != NULL; ql = g_list_previous(ql)) { query = ql->data; - if (query->uid == qd->uid) + if (query->uid == qd->uid) query->modify_info = TRUE; } } @@ -314,9 +314,9 @@ value = g_strdup_printf("%d", gaim_request_field_choice_get_value(field)); } else { value = (gchar *) gaim_request_field_string_get_value(field); - if (value == NULL) + if (value == NULL) value = g_strdup("-"); - else + else value = utf8_to_qq(value, QQ_CHARSET_DEFAULT); } *list = g_list_remove_link(*list, *list); @@ -382,25 +382,25 @@ return group; } -static void add_string_field_to_group(GaimRequestFieldGroup *group, +static void add_string_field_to_group(GaimRequestFieldGroup *group, const gchar *id, const gchar *title, const gchar *value) { GaimRequestField *field; gchar *utf8_value; - + utf8_value = qq_to_utf8(value, QQ_CHARSET_DEFAULT); field = gaim_request_field_string_new(id, title, utf8_value, FALSE); gaim_request_field_group_add_field(group, field); g_free(utf8_value); } -static void add_choice_field_to_group(GaimRequestFieldGroup *group, - const gchar *id, const gchar *title, const gchar *value, +static void add_choice_field_to_group(GaimRequestFieldGroup *group, + const gchar *id, const gchar *title, const gchar *value, const gchar **choice, gint choice_size) { GaimRequestField *field; gint i, index; - + index = choice_index(value, choice, choice_size); field = gaim_request_field_choice_new(id, title, index); for (i = 0; i < choice_size; i++) @@ -475,7 +475,7 @@ mid->info->is_open_contact = g_strdup(info->is_open_contact); mid->info->qq_show = g_strdup(info->qq_show); mid->info->unknown6 = g_strdup(info->unknown6); - + gaim_request_fields(gc, _("Modify my information"), _("Modify my information"), NULL, fields, _("Update my information"), G_CALLBACK(modify_info_ok_cb), @@ -515,14 +515,14 @@ qq_data *qd = (qq_data *) gc->proto_data; gint offset; - if(gaim_presence_is_status_primitive_active(presence, GAIM_STATUS_INVISIBLE)) { + if(gaim_presence_is_status_primitive_active(presence, GAIM_STATUS_INVISIBLE)) { offset = 2; - } else if(gaim_presence_is_status_primitive_active(presence, GAIM_STATUS_AWAY) - || gaim_presence_is_status_primitive_active(presence, GAIM_STATUS_EXTENDED_AWAY)) { + } else if(gaim_presence_is_status_primitive_active(presence, GAIM_STATUS_AWAY) + || gaim_presence_is_status_primitive_active(presence, GAIM_STATUS_EXTENDED_AWAY)) { offset = 1; - } else { + } else { offset = 0; - } + } qd->my_icon = 3 * (face_num - 1) + offset; qd->modifying_face = TRUE; @@ -531,58 +531,61 @@ void qq_set_buddy_icon_for_user(GaimAccount *account, const gchar *who, const gchar *iconfile) { - FILE *file; - struct stat st; + FILE *file; + struct stat st; - g_return_if_fail(g_stat(iconfile, &st) == 0); - file = g_fopen(iconfile, "rb"); - if (file) { + g_return_if_fail(g_stat(iconfile, &st) == 0); + file = g_fopen(iconfile, "rb"); + if (file) { GaimBuddyIcon *icon; - size_t data_len; - gchar *data = g_new(gchar, st.st_size + 1); - data_len = fread(data, 1, st.st_size, file); - fclose(file); - gaim_buddy_icons_set_for_user(account, who, data, data_len); + size_t data_len; + gchar *data = g_new(gchar, st.st_size + 1); + data_len = fread(data, 1, st.st_size, file); + fclose(file); + gaim_buddy_icons_set_for_user(account, who, data, data_len); icon = gaim_buddy_icons_find(account, who); gaim_buddy_icon_set_path(icon, iconfile); - } + } } /* TODO: figure out how/when we can use a custom face * for now, only allow the stock icons */ void qq_set_my_buddy_icon(GaimConnection *gc, const gchar *iconfile) { - gchar *icon; - gint icon_num; - GaimAccount *account = gaim_connection_get_account(gc); - const gchar *icon_path = gaim_account_get_buddy_icon_path(account); - gint prefix_len = strlen(QQ_ICON_PREFIX); - gint suffix_len = strlen(QQ_ICON_SUFFIX); - gint dir_len = strlen(QQBUDDYICONDIR); - gint icon_len = strlen(icon_path) - dir_len - 1 - prefix_len - suffix_len; - gchar *errmsg = g_strconcat(_("You are attempting to set a custom face. Gaim currently only allows the standard faces. Please choose an image from "), QQBUDDYICONDIR, ".", NULL); + gchar *icon; + gint icon_num; + GaimAccount *account = gaim_connection_get_account(gc); + const gchar *icon_path = gaim_account_get_buddy_icon_path(account); + gint prefix_len = strlen(QQ_ICON_PREFIX); + gint suffix_len = strlen(QQ_ICON_SUFFIX); + gint dir_len = strlen(QQBUDDYICONDIR); + gint icon_len = strlen(icon_path) - dir_len - 1 - prefix_len - suffix_len; + gchar *errmsg = g_strconcat(_("You are attempting to set a custom face. Gaim currently only allows the standard faces. Please choose an image from "), QQBUDDYICONDIR, ".", NULL); - /* make sure we're using an appropriate icon */ - if (!(g_ascii_strncasecmp(icon_path, QQBUDDYICONDIR, dir_len) == 0 - && icon_path[dir_len] == G_DIR_SEPARATOR - && g_ascii_strncasecmp(icon_path + dir_len + 1, QQ_ICON_PREFIX, prefix_len) == 0 - && g_ascii_strncasecmp(icon_path + dir_len + 1 + prefix_len + icon_len, QQ_ICON_SUFFIX, suffix_len) == 0 - && icon_len <= 3)) { - gaim_notify_error(gc, _("Invalid QQ Facea"), errmsg, NULL); - return; - } - /* strip everything but number */ - icon = g_strndup(icon_path + dir_len + 1 + prefix_len, icon_len); - icon_num = strtol(icon, NULL, 10); - g_free(icon); - /* ensure face number in proper range */ - if (icon_num > QQ_FACES) { - gaim_notify_error(gc, _("Invalid QQ Face"), errmsg, NULL); - return; - } - /* tell server my icon changed */ - _qq_send_packet_modify_face(gc, icon_num); - /* display in blist */ + /* make sure we're using an appropriate icon */ + if (!(g_ascii_strncasecmp(icon_path, QQBUDDYICONDIR, dir_len) == 0 + && icon_path[dir_len] == G_DIR_SEPARATOR + && g_ascii_strncasecmp(icon_path + dir_len + 1, QQ_ICON_PREFIX, prefix_len) == 0 + && g_ascii_strncasecmp(icon_path + dir_len + 1 + prefix_len + icon_len, QQ_ICON_SUFFIX, suffix_len) == 0 + && icon_len <= 3)) { + gaim_notify_error(gc, _("Invalid QQ Facea"), errmsg, NULL); + g_free(errmsg); + return; + } + /* strip everything but number */ + icon = g_strndup(icon_path + dir_len + 1 + prefix_len, icon_len); + icon_num = strtol(icon, NULL, 10); + g_free(icon); + /* ensure face number in proper range */ + if (icon_num > QQ_FACES) { + gaim_notify_error(gc, _("Invalid QQ Face"), errmsg, NULL); + g_free(errmsg); + return; + } + g_free(errmsg); + /* tell server my icon changed */ + _qq_send_packet_modify_face(gc, icon_num); + /* display in blist */ qq_set_buddy_icon_for_user(account, account->username, icon_path); } @@ -695,3 +698,14 @@ } gaim_debug(GAIM_DEBUG_INFO, "QQ", "%d info queries are freed!\n", i); } + +#ifdef _WIN32 +const char *qq_win32_buddy_icon_dir(void) +{ + static char *dir = NULL; + if (dir == NULL) + dir = g_build_filename(wgaim_install_dir(), "pixmaps", + "gaim", "buddy_icons", "qq", NULL); + return dir; +} +#endif Modified: trunk/libgaim/protocols/qq/qq.c =================================================================== --- trunk/libgaim/protocols/qq/qq.c 2006-11-30 16:50:14 UTC (rev 17858) +++ trunk/libgaim/protocols/qq/qq.c 2006-11-30 17:45:28 UTC (rev 17859) @@ -95,7 +95,7 @@ const gchar *qq_server, *qq_port; qq_data *qd; GaimConnection *gc; - GaimPresence *presence; + GaimPresence *presence; gboolean use_tcp; g_return_if_fail(account != NULL); @@ -112,7 +112,7 @@ qq_server = gaim_account_get_string(account, "server", NULL); qq_port = gaim_account_get_string(account, "port", NULL); use_tcp = gaim_account_get_bool(account, "use_tcp", FALSE); - presence = gaim_account_get_presence(account); + presence = gaim_account_get_presence(account); qd->use_tcp = use_tcp; @@ -127,14 +127,14 @@ if (qq_server == NULL || strlen(qq_server) == 0) qq_server = use_tcp ? - tcp_server_list[random() % tcp_server_amount] : + tcp_server_list[random() % tcp_server_amount] : udp_server_list[random() % udp_server_amount]; if (qq_port == NULL || strtol(qq_port, NULL, 10) == 0) qq_port = use_tcp ? QQ_TCP_QUERY_PORT : QQ_UDP_PORT; gaim_connection_update_progress(gc, _("Connecting"), 0, QQ_CONNECT_STEPS); - + if (qq_connect(account, qq_server, strtol(qq_port, NULL, 10), use_tcp, FALSE) < 0) gaim_connection_error(gc, _("Unable to connect.")); } @@ -184,7 +184,7 @@ break; default: g_string_printf(status, "Unknown-%d", q_bud->status); - } + } return g_string_free(status, FALSE); } @@ -205,30 +205,30 @@ { 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", + 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); g_string_append_printf(tooltip, "\n<b>Age:</b> %d", q_bud->age); - switch (q_bud->gender) { - case QQ_BUDDY_GENDER_GG: - g_string_append(tooltip, "\n<b>Gender:</b> Male"); - break; - case QQ_BUDDY_GENDER_MM: - g_string_append(tooltip, "\n<b>Gender:</b> Female"); - break; - case QQ_BUDDY_GENDER_UNKNOWN: - g_string_append(tooltip, "\n<b>Gender:</b> Unknown"); - break; - default: - g_string_append_printf(tooltip, "\n<b>Gender:</b> ERROR(%d)", q_bud->gender); - } + switch (q_bud->gender) { + case QQ_BUDDY_GENDER_GG: + g_string_append(tooltip, "\n<b>Gender:</b> Male"); + break; + case QQ_BUDDY_GENDER_MM: + g_string_append(tooltip, "\n<b>Gender:</b> Female"); + break; + case QQ_BUDDY_GENDER_UNKNOWN: + g_string_append(tooltip, "\n<b>Gender:</b> Unknown"); + break; + default: + g_string_append_printf(tooltip, "\n<b>Gender:</b> ERROR(%d)", q_bud->gender); + } /* For debugging */ /* g_string_append_printf(tooltip, "\n<b>Flag:</b> %01x", q_bud->flag1); g_string_append_printf(tooltip, "\n<b>CommFlag:</b> %01x", q_bud->comm_flag); - g_string_append_printf(tooltip, "\n<b>Client:</b> %04x", q_bud->client_version); + g_string_append_printf(tooltip, "\n<b>Client:</b> %04x", q_bud->client_version); */ } } @@ -239,11 +239,11 @@ /* each char** are refering to a filename in pixmaps/gaim/status/default/ */ qq_buddy *q_bud = b->proto_data; - const char *emblems[4] = { NULL, NULL, NULL, NULL }; - int i = 1; + const char *emblems[4] = { NULL, NULL, NULL, NULL }; + int i = 1; - if (q_bud == NULL) { - emblems[0] = "offline"; + if (q_bud == NULL) { + emblems[0] = "offline"; } else { if (q_bud->status == QQ_BUDDY_ONLINE_AWAY) emblems[i++] = "away"; @@ -251,25 +251,25 @@ if (q_bud->comm_flag & QQ_COMM_FLAG_QQ_MEMBER) emblems[i++] = "qq_member"; */ - if (q_bud->comm_flag & QQ_COMM_FLAG_BIND_MOBILE) - emblems[i++] = "wireless"; + if (q_bud->comm_flag & QQ_COMM_FLAG_BIND_MOBILE) + emblems[i++] = "wireless"; /* if (q_bud->comm_flag & QQ_COMM_FLAG_VIDEO) emblems[i%4] = "video"; */ - } + } - *se = emblems[0]; - *sw = emblems[1]; - *nw = emblems[2]; - *ne = emblems[3]; + *se = emblems[0]; + *sw = emblems[1]; + *nw = emblems[2]; + *ne = emblems[3]; return; } /* QQ away status (used to initiate QQ away packet) */ -static GList *_qq_away_states(GaimAccount *ga) +static GList *_qq_away_states(GaimAccount *ga) { GaimStatusType *status; GList *types = NULL; @@ -278,17 +278,17 @@ "available", _("QQ: Available"), FALSE, TRUE, FALSE); types = g_list_append(types, status); - status = gaim_status_type_new_full(GAIM_STATUS_AWAY, + status = gaim_status_type_new_full(GAIM_STATUS_AWAY, "away", _("QQ: Away"), FALSE, TRUE, FALSE); - types = g_list_append(types, status); + types = g_list_append(types, status); - status = gaim_status_type_new_full(GAIM_STATUS_INVISIBLE, + status = gaim_status_type_new_full(GAIM_STATUS_INVISIBLE, "invisible", _("QQ: Invisible"), FALSE, TRUE, FALSE); - types = g_list_append(types, status); + types = g_list_append(types, status); status = gaim_status_type_new_full(GAIM_STATUS_OFFLINE, - "offline", _("QQ: Offline"), FALSE, TRUE, FALSE); - types = g_list_append(types, status); + "offline", _("QQ: Offline"), FALSE, TRUE, FALSE); + types = g_list_append(types, status); return types; } @@ -568,12 +568,12 @@ if(GAIM_BLIST_NODE_IS_CHAT(node)) return _qq_chat_menu(node); - + m = NULL; return m; } -/* TODO : not working, temp commented out by gfhuang +/* TODO : not working, temp commented out by gfhuang act = gaim_menu_action_new(_("Block this buddy"), GAIM_CALLBACK(_qq_menu_block_buddy), NULL, NULL); //add NULL by gfhuang m = g_list_append(m, act); @@ -604,7 +604,7 @@ group->my_status == QQ_GROUP_MEMBER_STATUS_IS_ADMIN) /* no need to get info time and time again, online members enough */ qq_send_cmd_group_get_online_members(gc, group); - + list = list->next; } @@ -678,7 +678,7 @@ NULL, /* alias_buddy */ NULL, /* group_buddy */ NULL, /* rename_group */ - NULL, /* buddy_free */ + NULL, /* buddy_free */ NULL, /* convo_closed */ NULL, /* normalize */ qq_set_my_buddy_icon, /* set_buddy_icon */ @@ -691,7 +691,7 @@ NULL, /* roomlist_expand_category */ NULL, /* can_receive_file */ qq_send_file, /* send_file */ - NULL, /* new xfer */ + NULL, /* new xfer */ NULL, /* offline_message */ NULL, /* GaimWhiteboardPrplOps */ NULL, /* send_raw */ Modified: trunk/libgaim/protocols/qq/qq.h =================================================================== --- trunk/libgaim/protocols/qq/qq.h 2006-11-30 16:50:14 UTC (rev 17858) +++ trunk/libgaim/protocols/qq/qq.h 2006-11-30 17:45:28 UTC (rev 17859) @@ -35,6 +35,11 @@ #define QQ_KEY_LENGTH 16 #define QQ_DEBUG 1 /* whether we are doing DEBUG */ +#ifdef _WIN32 +const char *qq_win32_buddy_icon_dir(void); +#define QQBUDDYICONDIR qq_win32_buddy_icon_dir() +#endif + typedef struct _qq_data qq_data; typedef struct _qq_buddy qq_buddy; Modified: trunk/libgaim/protocols/qq/utils.c =================================================================== --- trunk/libgaim/protocols/qq/utils.c 2006-11-30 16:50:14 UTC (rev 17858) +++ trunk/libgaim/protocols/qq/utils.c 2006-11-30 17:45:28 UTC (rev 17859) @@ -51,7 +51,7 @@ return array[index]; } -gchar *get_index_str_by_name(gchar **array, const gchar *name, gint amount) +gchar *get_index_str_by_name(gchar **array, const gchar *name, gint amount) { gint index; @@ -106,7 +106,7 @@ gaim_debug(GAIM_DEBUG_WARNING, "QQ", "field[%d] is %s\n", j, segments[j]); g_free(segments[j]); } - + segments[expected_fields] = NULL; } @@ -116,21 +116,21 @@ /* generate a md5 key using uid and session_key */ guint8 *_gen_session_md5(gint uid, guint8 *session_key) { - guint8 *src, md5_str[QQ_KEY_LENGTH]; - GaimCipher *cipher; - GaimCipherContext *context; + guint8 *src, md5_str[QQ_KEY_LENGTH]; + GaimCipher *cipher; + GaimCipherContext *context; - src = g_newa(guint8, 20); + src = g_newa(guint8, 20); memcpy(src, &uid, 4); memcpy(src, session_key, QQ_KEY_LENGTH); - cipher = gaim_ciphers_find_cipher("md5"); - context = gaim_cipher_context_new(cipher, NULL); - gaim_cipher_context_append(context, src, 20); - gaim_cipher_context_digest(context, sizeof(md5_str), md5_str, NULL); - gaim_cipher_context_destroy(context); + cipher = gaim_ciphers_find_cipher("md5"); + context = gaim_cipher_context_new(cipher, NULL); + gaim_cipher_context_append(context, src, 20); + gaim_cipher_context_digest(context, sizeof(md5_str), md5_str, NULL); + gaim_cipher_context_destroy(context); - return g_memdup(md5_str, QQ_KEY_LENGTH); + return g_memdup(md5_str, QQ_KEY_LENGTH); } /* given a four-byte ip data, convert it into a human readable ip string @@ -141,7 +141,7 @@ if (ip == NULL || ip[0] == 0) { ret = g_new(gchar, 1); *ret = '\0'; - return ret; + return ret; } else { return g_strdup_printf("%d.%d.%d.%d", ip[0], ip[1], ip[2], ip[3]); } @@ -168,7 +168,7 @@ ret = strtol(name, NULL, 10); if (errno == ERANGE) return 0; - else + else return ret; } @@ -182,7 +182,7 @@ /* convert name displayed in a chat channel to original QQ UID */ gchar *chat_name_to_gaim_name(const gchar *const name) { - const gchar *tmp; + const gchar *tmp; gchar *ret; g_return_val_if_fail(name != NULL, NULL); @@ -203,7 +203,7 @@ incoming = g_newa(guint8, len + 1); g_memmove(incoming, data, len); incoming[len] = 0x00; - /* GBK code: + /* GBK code: * Single-byte ASCII: 0x21-0x7E * GBK first byte range: 0x81-0xFE * GBK second byte range: 0x40-0x7E and 0x80-0xFE */ @@ -228,19 +228,19 @@ g_return_val_if_fail(buffer != NULL, NULL); - stripped = g_string_new(""); - for (i=0; i<strlen(buffer); i++) { + stripped = g_string_new(""); + for (i=0; i<strlen(buffer); i++) { cur = buffer[i]; if (cur != ' ' && cur != '\n') - g_string_append_c(stripped, buffer[i]); - } + g_string_append_c(stripped, buffer[i]); + } ret = stripped->str; g_string_free(stripped, FALSE); - return ret; + return ret; } -/* Attempts to dump an ASCII hex string to a string of bytes. +/* Attempts to dump an ASCII hex string to a string of bytes. * The return should be freed later. */ guint8 *hex_str_to_bytes(const gchar *const buffer, gint *out_len) { @@ -249,7 +249,7 @@ gint index; g_return_val_if_fail(buffer != NULL, NULL); - + hex_buffer = strstrip(buffer); if (strlen(hex_buffer) % 2 != 0) { @@ -292,7 +292,7 @@ return g_memdup(bytes, *out_len); } -/* Dumps a chunk of raw data into an ASCII hex string. +/* Dumps a chunk of raw data into an ASCII hex string. * The return should be freed later. */ gchar *hex_dump_to_str(const guint8 *const buffer, gint bytes) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |