You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
(997) |
May
(483) |
Jun
(142) |
Jul
(209) |
Aug
(109) |
Sep
(135) |
Oct
(213) |
Nov
(46) |
Dec
(93) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(59) |
Feb
(11) |
Mar
(8) |
Apr
(2) |
May
(5) |
Jun
(16) |
Jul
(14) |
Aug
(5) |
Sep
(2) |
Oct
|
Nov
|
Dec
(8) |
2005 |
Jan
|
Feb
(18) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(6) |
Nov
(4) |
Dec
|
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(14) |
2007 |
Jan
(79) |
Feb
(47) |
Mar
(30) |
Apr
(30) |
May
(6) |
Jun
(13) |
Jul
(10) |
Aug
(72) |
Sep
(4) |
Oct
(30) |
Nov
(10) |
Dec
(13) |
2008 |
Jan
|
Feb
|
Mar
(12) |
Apr
(5) |
May
|
Jun
(50) |
Jul
(32) |
Aug
(70) |
Sep
(4) |
Oct
(1) |
Nov
(9) |
Dec
|
2009 |
Jan
|
Feb
(7) |
Mar
(11) |
Apr
(16) |
May
(19) |
Jun
(4) |
Jul
(100) |
Aug
(141) |
Sep
(89) |
Oct
(25) |
Nov
(26) |
Dec
(1) |
2010 |
Jan
(5) |
Feb
(11) |
Mar
(2) |
Apr
(3) |
May
(2) |
Jun
(1) |
Jul
(5) |
Aug
(1) |
Sep
|
Oct
(1) |
Nov
|
Dec
(1) |
2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(2) |
2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
From: Siddhesh P. <sid...@us...> - 2009-09-04 17:30:37
|
Update of /cvsroot/ayttm/ayttm/modules/msn2/libmsn2 In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv23017/modules/msn2/libmsn2 Modified Files: msn-connection.c msn-connection.h msn-login.c msn.c Log Message: * MSN: Fix random crashes on connection cancellation Index: msn-connection.c =================================================================== RCS file: /cvsroot/ayttm/ayttm/modules/msn2/libmsn2/msn-connection.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- msn-connection.c 31 Aug 2009 08:48:26 -0000 1.7 +++ msn-connection.c 4 Sep 2009 17:30:26 -0000 1.8 @@ -29,6 +29,8 @@ #include "msn-http.h" #include "msn-ext.h" +#define __DEBUG__ 0 + typedef struct { int trid; MsnCallbackHandler handler; @@ -151,6 +153,9 @@ /* Orphaned so that it can be freed */ if(!mc->account) { + if(mc->type != MSN_CONNECTION_NS) + ma->connections = l_list_remove(ma->connections, mc); + msn_connection_free(mc); return 1; } @@ -168,8 +173,21 @@ ext_msn_send_data(mc,data,len); } +MsnConnection *msn_connection_new() +{ + MsnConnection *mc = m_new0(MsnConnection, 1); +#if __DEBUG__ + fprintf(stderr, "Creating %p\n", mc); +#endif + + return mc; +} + void msn_connection_free(MsnConnection *mc) { +#if __DEBUG__ + fprintf(stderr, "Freeing %p\n", mc); +#endif if(!mc) return; Index: msn-connection.h =================================================================== RCS file: /cvsroot/ayttm/ayttm/modules/msn2/libmsn2/msn-connection.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- msn-connection.h 30 Aug 2009 14:55:58 -0000 1.4 +++ msn-connection.h 4 Sep 2009 17:30:26 -0000 1.5 @@ -81,7 +81,7 @@ void msn_connection_push_callback(MsnConnection *mc, MsnCallbackHandler handle, void *data); int msn_connection_pop_callback(MsnConnection *mc); -#define msn_connection_new() ( m_new0(MsnConnection, 1) ) +MsnConnection *msn_connection_new(); #define msn_connection_free_current_message(mc) { \ if (mc->current_message) { \ Index: msn-login.c =================================================================== RCS file: /cvsroot/ayttm/ayttm/modules/msn2/libmsn2/msn-login.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- msn-login.c 31 Aug 2009 08:48:26 -0000 1.9 +++ msn-login.c 4 Sep 2009 17:30:26 -0000 1.10 @@ -248,11 +248,7 @@ if(!ma->ticket) { /* Flag Error */ - msn_connection_free(ma->ns_connection); - ma->ns_connection = NULL; - fprintf(stderr, "No ticket!!\n"); - ext_msn_login_response(ma, MSN_LOGIN_FAIL_SSO); return; @@ -274,9 +270,6 @@ if(!ma->secret) { /* Flag Error */ - msn_connection_free(ma->ns_connection); - ma->ns_connection = NULL; - fprintf(stderr, "No secret!!\n"); ext_msn_login_response(ma, MSN_LOGIN_FAIL_SSO); @@ -302,9 +295,6 @@ if(!ma->contact_ticket) { /* Flag Error */ - msn_connection_free(ma->ns_connection); - ma->ns_connection = NULL; - fprintf(stderr, "No contact ticket!!\n"); ext_msn_login_response(ma, MSN_LOGIN_FAIL_SSO); @@ -466,7 +456,9 @@ { LList *l = NULL; - msn_message_send(ma->ns_connection, NULL, MSN_COMMAND_OUT); + /* Don't bother if the connection has already been freed */ + if(ma->ns_connection) + msn_message_send(ma->ns_connection, NULL, MSN_COMMAND_OUT); msn_connection_free(ma->ns_connection); ma->ns_connection = NULL; @@ -487,11 +479,12 @@ for(l = ma->connections; l; l = l_list_next(l)) { MsnConnection *con = l->data; - /* HTTP connections clean up themselves. Don't bother. */ - if(con->type != MSN_CONNECTION_HTTP) - msn_connection_free(con); + msn_connection_free(con); } + l_list_free(ma->connections); + ma->connections = NULL; + l_list_foreach(ma->buddies, (LListFunc)msn_buddy_reset, NULL); } Index: msn.c =================================================================== RCS file: /cvsroot/ayttm/ayttm/modules/msn2/libmsn2/msn.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- msn.c 30 Aug 2009 19:37:33 -0000 1.7 +++ msn.c 4 Sep 2009 17:30:26 -0000 1.8 @@ -75,10 +75,11 @@ for(l = ma->connections; l; l = l_list_next(l)) { MsnConnection *con = l->data; - /* HTTP connections clean up themselves. Don't bother. */ - if(con->type != MSN_CONNECTION_HTTP) - msn_connection_free(con); + msn_connection_free(con); } + + l_list_free(ma->connections); + ma->connections = NULL; } |
From: Siddhesh P. <sid...@us...> - 2009-09-04 17:30:36
|
Update of /cvsroot/ayttm/ayttm/modules/msn2 In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv23017/modules/msn2 Modified Files: msn.c Log Message: * MSN: Fix random crashes on connection cancellation Index: msn.c =================================================================== RCS file: /cvsroot/ayttm/ayttm/modules/msn2/msn.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- msn.c 31 Aug 2009 11:10:01 -0000 1.9 +++ msn.c 4 Sep 2009 17:30:26 -0000 1.10 @@ -1584,7 +1584,8 @@ memset(buf, 0, sizeof(buf)); - if(!ela->connecting && !ela->connected) { + /* We're logged out. Clean up. */ + if((!ela->connecting && !ela->connected) || !mc->account->ns_connection) { ay_msn_logout(ela); return; } |
From: Siddhesh P. <sid...@us...> - 2009-08-31 11:10:14
|
Update of /cvsroot/ayttm/ayttm In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv15478 Modified Files: ChangeLog configure.ac Log Message: * MSN: Handle case when buddy is in Allow list as well as Pending * MSN: Continue processing all Member roles Index: ChangeLog =================================================================== RCS file: /cvsroot/ayttm/ayttm/ChangeLog,v retrieving revision 1.815 retrieving revision 1.816 diff -u -r1.815 -r1.816 --- ChangeLog 31 Aug 2009 08:48:26 -0000 1.815 +++ ChangeLog 31 Aug 2009 11:10:00 -0000 1.816 @@ -1,3 +1,9 @@ +* Mon Aug 31 2009 11:05 UTC [siddheshp] 0.5.0-141 +- ChangeLog, configure.ac, modules/msn2/msn.c, +modules/msn2/libmsn2/msn-contacts.c: + * MSN: Handle case when buddy is in Allow list as well as Pending + * MSN: Continue processing all Member roles + * Mon Aug 31 2009 08:45 UTC [siddheshp] 0.5.0-140 - ChangeLog, configure.ac, modules/msn2/libmsn2/msn-connection.c, modules/msn2/libmsn2/msn-login.c: Index: configure.ac =================================================================== RCS file: /cvsroot/ayttm/ayttm/configure.ac,v retrieving revision 1.631 retrieving revision 1.632 diff -u -r1.631 -r1.632 --- configure.ac 31 Aug 2009 08:48:26 -0000 1.631 +++ configure.ac 31 Aug 2009 11:10:01 -0000 1.632 @@ -5,7 +5,7 @@ AC_PREREQ(2.53) AC_CONFIG_SRCDIR(src/main.c) AM_INIT_AUTOMAKE([1.6 dist-bzip2 dist-zip]) -RELEASE=140 +RELEASE=141 # This is to check modules/core binary compat # Bump it up when necessary only (query_callbacks change, struct change etc) |
From: Siddhesh P. <sid...@us...> - 2009-08-31 11:10:12
|
Update of /cvsroot/ayttm/ayttm/modules/msn2 In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv15478/modules/msn2 Modified Files: msn.c Log Message: * MSN: Handle case when buddy is in Allow list as well as Pending * MSN: Continue processing all Member roles Index: msn.c =================================================================== RCS file: /cvsroot/ayttm/ayttm/modules/msn2/msn.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- msn.c 30 Aug 2009 19:37:32 -0000 1.8 +++ msn.c 31 Aug 2009 11:10:01 -0000 1.9 @@ -828,7 +828,8 @@ MsnBuddy *bud = buds->data; int changed = FALSE; - if (bud->list & MSN_BUDDY_PENDING) { + /* I got a case when buddy was in allow as well as pending. Weird. */ + if (!(bud->list & MSN_BUDDY_ALLOW) && bud->list & MSN_BUDDY_PENDING) { changed = ay_msn_authorize_user(ela, bud); if(!changed) continue; |
From: Siddhesh P. <sid...@us...> - 2009-08-31 11:10:11
|
Update of /cvsroot/ayttm/ayttm/modules/msn2/libmsn2 In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv15478/modules/msn2/libmsn2 Modified Files: msn-contacts.c Log Message: * MSN: Handle case when buddy is in Allow list as well as Pending * MSN: Continue processing all Member roles Index: msn-contacts.c =================================================================== RCS file: /cvsroot/ayttm/ayttm/modules/msn2/libmsn2/msn-contacts.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- msn-contacts.c 30 Aug 2009 19:37:32 -0000 1.7 +++ msn-contacts.c 31 Aug 2009 11:10:02 -0000 1.8 @@ -475,6 +475,10 @@ if(!chunk) break; +#if __DEBUG__ + printf("Processing List :: %s\n", chunk); +#endif + if(!strcmp(chunk, "Forward")) cur_type = MSN_BUDDY_FORWARD; else if(!strcmp(chunk, "Allow")) @@ -486,12 +490,12 @@ else if(!strcmp(chunk, "Pending")) cur_type = MSN_BUDDY_PENDING; else - break; /* We don't really care about anything else */ + continue; /* We don't really care about anything else */ /* Now Pick members in the list */ _get_next_tag_chunk(&chunk, &offset, "Members"); if(!chunk) - break; + continue; while(chunk) { int type = 0; |
From: Siddhesh P. <sid...@us...> - 2009-08-31 08:48:37
|
Update of /cvsroot/ayttm/ayttm/modules/msn2/libmsn2 In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv8570/modules/msn2/libmsn2 Modified Files: msn-connection.c msn-login.c Log Message: * MSN: Cease polling immediately after freeing connection Index: msn-connection.c =================================================================== RCS file: /cvsroot/ayttm/ayttm/modules/msn2/libmsn2/msn-connection.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- msn-connection.c 30 Aug 2009 19:37:32 -0000 1.6 +++ msn-connection.c 31 Aug 2009 08:48:26 -0000 1.7 @@ -142,7 +142,7 @@ * Check if this is a response to a previous message * Otherwise look for the default handler for the message */ - if( !msn_message_is_error(mc) && msn_connection_pop_callback(mc) == 0 ) + if( msn_connection_pop_callback(mc) == 0 ) msn_message_handle_incoming(mc); /* Connection could have been freed earlier */ @@ -150,8 +150,10 @@ msn_connection_free_current_message(mc); /* Orphaned so that it can be freed */ - if(!mc->account) + if(!mc->account) { msn_connection_free(mc); + return 1; + } } } } while(remaining > 0); Index: msn-login.c =================================================================== RCS file: /cvsroot/ayttm/ayttm/modules/msn2/libmsn2/msn-login.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- msn-login.c 30 Aug 2009 19:37:33 -0000 1.8 +++ msn-login.c 31 Aug 2009 08:48:26 -0000 1.9 @@ -361,7 +361,7 @@ ma->ns_connection = NULL; ext_msn_login_response(mc->account, MSN_LOGIN_FAIL_OTHER); - mc->account = NULL; + msn_connection_free(mc); return; } |
From: Siddhesh P. <sid...@us...> - 2009-08-31 08:48:36
|
Update of /cvsroot/ayttm/ayttm In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv8570 Modified Files: ChangeLog configure.ac Log Message: * MSN: Cease polling immediately after freeing connection Index: ChangeLog =================================================================== RCS file: /cvsroot/ayttm/ayttm/ChangeLog,v retrieving revision 1.814 retrieving revision 1.815 diff -u -r1.814 -r1.815 --- ChangeLog 30 Aug 2009 19:37:33 -0000 1.814 +++ ChangeLog 31 Aug 2009 08:48:26 -0000 1.815 @@ -1,3 +1,8 @@ +* Mon Aug 31 2009 08:45 UTC [siddheshp] 0.5.0-140 +- ChangeLog, configure.ac, modules/msn2/libmsn2/msn-connection.c, +modules/msn2/libmsn2/msn-login.c: + * MSN: Cease polling immediately after freeing connection + * Sun Aug 30 2009 14:55 UTC [siddheshp] 0.5.0-139 - ChangeLog, configure.ac, modules/msn2/msn.c, modules/msn2/libmsn2/msn-connection.c, modules/msn2/libmsn2/msn-contacts.c, Index: configure.ac =================================================================== RCS file: /cvsroot/ayttm/ayttm/configure.ac,v retrieving revision 1.630 retrieving revision 1.631 diff -u -r1.630 -r1.631 --- configure.ac 30 Aug 2009 19:37:33 -0000 1.630 +++ configure.ac 31 Aug 2009 08:48:26 -0000 1.631 @@ -5,7 +5,7 @@ AC_PREREQ(2.53) AC_CONFIG_SRCDIR(src/main.c) AM_INIT_AUTOMAKE([1.6 dist-bzip2 dist-zip]) -RELEASE=139 +RELEASE=140 # This is to check modules/core binary compat # Bump it up when necessary only (query_callbacks change, struct change etc) |
From: Siddhesh P. <sid...@us...> - 2009-08-30 19:37:53
|
Update of /cvsroot/ayttm/ayttm In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv18091 Modified Files: ChangeLog configure.ac Log Message: * MSN: Create Address book if it does not exist * MSN: New users do not have any BLP setting by default * MSN: Fixed memory corruption when an invalid username/password is provided * MSN: Fixed a couple of corner cases where freeing a connection could cause a crash Index: ChangeLog =================================================================== RCS file: /cvsroot/ayttm/ayttm/ChangeLog,v retrieving revision 1.813 retrieving revision 1.814 diff -u -r1.813 -r1.814 --- ChangeLog 30 Aug 2009 14:55:57 -0000 1.813 +++ ChangeLog 30 Aug 2009 19:37:33 -0000 1.814 @@ -1,3 +1,15 @@ +* Sun Aug 30 2009 14:55 UTC [siddheshp] 0.5.0-139 +- ChangeLog, configure.ac, modules/msn2/msn.c, +modules/msn2/libmsn2/msn-connection.c, modules/msn2/libmsn2/msn-contacts.c, +modules/msn2/libmsn2/msn-errors.c, modules/msn2/libmsn2/msn-login.c, +modules/msn2/libmsn2/msn-soap.c, modules/msn2/libmsn2/msn-soap.h, +modules/msn2/libmsn2/msn.c: + * MSN: Create Address book if it does not exist + * MSN: New users do not have any BLP setting by default + * MSN: Fixed memory corruption when an invalid username/password is provided + * MSN: Fixed a couple of corner cases where freeing a connection could cause + a crash + * Sun Aug 30 2009 14:55 UTC [siddheshp] 0.5.0-138 - ChangeLog, configure.ac, modules/aim-oscar/aim-oscar.c, modules/irc/irc.c, modules/irc/irc.h, modules/jabber/jabber.c, modules/msn2/msn.c, Index: configure.ac =================================================================== RCS file: /cvsroot/ayttm/ayttm/configure.ac,v retrieving revision 1.629 retrieving revision 1.630 diff -u -r1.629 -r1.630 --- configure.ac 30 Aug 2009 14:09:09 -0000 1.629 +++ configure.ac 30 Aug 2009 19:37:33 -0000 1.630 @@ -5,7 +5,7 @@ AC_PREREQ(2.53) AC_CONFIG_SRCDIR(src/main.c) AM_INIT_AUTOMAKE([1.6 dist-bzip2 dist-zip]) -RELEASE=137 +RELEASE=139 # This is to check modules/core binary compat # Bump it up when necessary only (query_callbacks change, struct change etc) |
From: Siddhesh P. <sid...@us...> - 2009-08-30 19:37:46
|
Update of /cvsroot/ayttm/ayttm/modules/msn2 In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv18091/modules/msn2 Modified Files: msn.c Log Message: * MSN: Create Address book if it does not exist * MSN: New users do not have any BLP setting by default * MSN: Fixed memory corruption when an invalid username/password is provided * MSN: Fixed a couple of corner cases where freeing a connection could cause a crash Index: msn.c =================================================================== RCS file: /cvsroot/ayttm/ayttm/modules/msn2/msn.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- msn.c 30 Aug 2009 14:55:58 -0000 1.7 +++ msn.c 30 Aug 2009 19:37:32 -0000 1.8 @@ -677,6 +677,8 @@ MsnConnectionCallback callback = ((struct ay_msn_cbdata *)data)->callback; eb_local_account *ela = (eb_local_account *)mc->account->ext_data; + mc->ext_data = fd; + if(!fd || error) { char errbuf[1024]; @@ -703,8 +705,6 @@ mc->tag_c = 0; - mc->ext_data = fd; - ext_register_read(mc); ay_msn_connect_status(_("Connected, sending login information"), mc); |
From: Siddhesh P. <sid...@us...> - 2009-08-30 19:37:42
|
Update of /cvsroot/ayttm/ayttm/modules/msn2/libmsn2 In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv18091/modules/msn2/libmsn2 Modified Files: msn-connection.c msn-contacts.c msn-errors.c msn-login.c msn-soap.c msn-soap.h msn.c Log Message: * MSN: Create Address book if it does not exist * MSN: New users do not have any BLP setting by default * MSN: Fixed memory corruption when an invalid username/password is provided * MSN: Fixed a couple of corner cases where freeing a connection could cause a crash Index: msn-connection.c =================================================================== RCS file: /cvsroot/ayttm/ayttm/modules/msn2/libmsn2/msn-connection.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- msn-connection.c 30 Aug 2009 14:55:58 -0000 1.5 +++ msn-connection.c 30 Aug 2009 19:37:32 -0000 1.6 @@ -117,6 +117,8 @@ } else if (mc->type == MSN_CONNECTION_NS || mc->type == MSN_CONNECTION_SB) { + MsnAccount *ma = mc->account; + if(len == 0) { const MsnError *error = msn_strerror(MSN_ERROR_CONNECTION_RESET); ext_msn_error(mc, error); @@ -143,11 +145,13 @@ if( !msn_message_is_error(mc) && msn_connection_pop_callback(mc) == 0 ) msn_message_handle_incoming(mc); - if( mc->account ) { + /* Connection could have been freed earlier */ + if( ma->ns_connection ) { msn_connection_free_current_message(mc); - } - else { - msn_connection_free(mc); + + /* Orphaned so that it can be freed */ + if(!mc->account) + msn_connection_free(mc); } } } while(remaining > 0); @@ -163,7 +167,10 @@ } void msn_connection_free(MsnConnection *mc) -{ +{ + if(!mc) + return; + ext_msn_free(mc); msn_connection_free_current_message(mc); l_list_free(mc->callbacks); Index: msn-contacts.c =================================================================== RCS file: /cvsroot/ayttm/ayttm/modules/msn2/libmsn2/msn-contacts.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- msn-contacts.c 30 Aug 2009 14:55:58 -0000 1.6 +++ msn-contacts.c 30 Aug 2009 19:37:32 -0000 1.7 @@ -159,6 +159,7 @@ int offset = 0; char *cur_domain = NULL; int cur_type = 0; + int sent = 0; /* Sort the list */ while(in) { @@ -225,6 +226,7 @@ else msn_message_send(ma->ns_connection, buf, MSN_COMMAND_FQY, bufsize); + sent = 1; buf[0] = '\0'; offset = 0; count = 0; @@ -256,9 +258,14 @@ msn_message_send(ma->ns_connection, buf, MSN_COMMAND_ADL, bufsize); else msn_message_send(ma->ns_connection, buf, MSN_COMMAND_FQY, bufsize); + + sent = 1; } - msn_connection_push_callback(ma->ns_connection, msn_got_initial_adl_response, NULL); + if(sent) + msn_connection_push_callback(ma->ns_connection, msn_got_initial_adl_response, NULL); + else + ext_msn_contacts_synced(ma); } @@ -270,11 +277,12 @@ char *chunk; char *blp_offset; + /* Pick groups */ _get_next_tag_chunk(&chunk, &offset, "groups"); if(!chunk) - return; + goto ret; while(chunk) { char *in_offset = chunk; @@ -302,18 +310,16 @@ _get_next_tag_chunk(&chunk, &offset, "contacts"); if(!chunk) - return; + goto ret; /* HACK! Get BLP. We don't seem to need GTC anymore */ blp_offset = strstr(chunk, "MSN.IM.BLP"); - if(!blp_offset) { - ext_show_error(ma->ns_connection, "Invalid Address book data from server"); + if(blp_offset) { + blp_offset = strstr(blp_offset, "<Value>"); + blp_offset += 7; + ma->blp = blp_offset[0] - '0'; } - blp_offset = strstr(blp_offset, "<Value>"); - blp_offset += 7; - ma->blp = blp_offset[0] - '0'; - msn_message_send(ma->ns_connection, NULL, MSN_COMMAND_BLP, ma->blp?MSN_PRIVACY_ALLOW:MSN_PRIVACY_BLOCK); while(chunk) { @@ -412,6 +418,7 @@ } } +ret: _send_adl(ma); /* Send your friendly name */ @@ -433,11 +440,33 @@ } +static void msn_ab_create_response(MsnAccount *ma, char *data, int len, void *cbdata) +{ + /* Give it another shot */ + msn_sync_contacts(ma); +} + + static void msn_membership_response(MsnAccount *ma, char *data, int len, void *cbdata) { char *offset = data; MsnBuddyType cur_type = -1; + /* Does not have an address book. Create one. */ + if(strstr(data, "ABDoesNotExist")) { + char *url = strdup("https://contacts.msn.com/abservice/abservice.asmx"); + char *soap_action = "http://www.msn.com/webservices/AddressBook/ABAdd"; + + char *ab_request = msn_soap_build_request(MSN_CREATE_ADDRESS_BOOK, ma->contact_ticket, ma->passport); + + msn_http_request(ma, MSN_HTTP_POST, soap_action, url, ab_request, msn_ab_create_response, NULL, NULL); + + free(url); + free(ab_request); + + return; + } + while (offset) { char *chunk; Index: msn-errors.c =================================================================== RCS file: /cvsroot/ayttm/ayttm/modules/msn2/libmsn2/msn-errors.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- msn-errors.c 24 Aug 2009 12:12:11 -0000 1.2 +++ msn-errors.c 30 Aug 2009 19:37:32 -0000 1.3 @@ -74,7 +74,7 @@ {MSN_ERROR_CONNECTION_RESET, "Server closed connection", 1, 0}, {MSN_LOGIN_FAIL_PASSPORT, "Invalid username", 1, 1}, - {MSN_LOGIN_FAIL_SSO, "Authentication failed", 1, 1}, + {MSN_LOGIN_FAIL_SSO, "Invalid Username or password", 1, 1}, {MSN_LOGIN_FAIL_VER, "Error during login", 1, 1}, {MSN_LOGIN_FAIL_OTHER, "Login failed due to unknown reasons", 1, 1}, {MSN_MESSAGE_DELIVERY_FAILED, "Failed to deliver message", 0, 0}, Index: msn-login.c =================================================================== RCS file: /cvsroot/ayttm/ayttm/modules/msn2/libmsn2/msn-login.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- msn-login.c 30 Aug 2009 14:55:58 -0000 1.7 +++ msn-login.c 30 Aug 2009 19:37:33 -0000 1.8 @@ -464,6 +464,8 @@ void msn_logout(MsnAccount *ma) { + LList *l = NULL; + msn_message_send(ma->ns_connection, NULL, MSN_COMMAND_OUT); msn_connection_free(ma->ns_connection); @@ -471,7 +473,24 @@ ma->status = MSN_STATE_OFFLINE; - l_list_foreach(ma->connections, (LListFunc)msn_connection_free, NULL); + free(ma->ticket); + free(ma->nonce); + free(ma->secret); + free(ma->contact_ticket); + free(ma->policy); + + ma->ticket = NULL; + ma->nonce = NULL; + ma->secret = NULL; + ma->contact_ticket = NULL; + ma->policy = NULL; + + for(l = ma->connections; l; l = l_list_next(l)) { + MsnConnection *con = l->data; + /* HTTP connections clean up themselves. Don't bother. */ + if(con->type != MSN_CONNECTION_HTTP) + msn_connection_free(con); + } l_list_foreach(ma->buddies, (LListFunc)msn_buddy_reset, NULL); } Index: msn-soap.c =================================================================== RCS file: /cvsroot/ayttm/ayttm/modules/msn2/libmsn2/msn-soap.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- msn-soap.c 24 Aug 2009 12:12:11 -0000 1.5 +++ msn-soap.c 30 Aug 2009 19:37:33 -0000 1.6 @@ -117,6 +117,38 @@ "</soap:Envelope>"; +const char *MSN_CREATE_ADDRESS_BOOK = +"<?xml version=\"1.0\" encoding=\"utf-8\"?>" +"<soap:Envelope" + " xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\"" + " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"" + " xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"" + " xmlns:soapenc=\"http://schemas.xmlsoap.org/soap/encoding/\">" + "<soap:Header>" + "<ABApplicationHeader xmlns=\"http://www.msn.com/webservices/AddressBook\">" + "<ApplicationId>CFE80F9D-180F-4399-82AB-413F33A1FA11</ApplicationId>" + "<IsMigration>false</IsMigration>" + "<PartnerScenario>Initial</PartnerScenario>" + "</ABApplicationHeader>" + "<ABAuthHeader xmlns=\"http://www.msn.com/webservices/AddressBook\">" + "<ManagedGroupRequest>false</ManagedGroupRequest>" + "<TicketToken>%s</TicketToken>" + "</ABAuthHeader>" + "</soap:Header>" + "<soap:Body>" + "<ABAdd xmlns=\"http://www.msn.com/webservices/AddressBook\">" + "<abInfo>" + "<name/>" + "<ownerPuid>0</ownerPuid>" + "<ownerEmail>%s</ownerEmail>" + "<fDefault>true</fDefault>" + "</abInfo>" + "</ABAdd>" + "</soap:Body>" +"</soap:Envelope>"; + + + const char *MSN_CONTACT_LIST_REQUEST = "<?xml version=\"1.0\" encoding=\"utf-8\"?>" "<soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soapenc=\"http://schemas.xmlsoap.org/soap/encoding/\">" Index: msn-soap.h =================================================================== RCS file: /cvsroot/ayttm/ayttm/modules/msn2/libmsn2/msn-soap.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- msn-soap.h 24 Aug 2009 12:12:11 -0000 1.5 +++ msn-soap.h 30 Aug 2009 19:37:33 -0000 1.6 @@ -26,6 +26,7 @@ extern const char *MSN_SOAP_LOGIN_REQUEST; extern const char *MSN_MEMBERSHIP_LIST_REQUEST; extern const char *MSN_MEMBERSHIP_LIST_MODIFY; +extern const char *MSN_CREATE_ADDRESS_BOOK; extern const char *MSN_CONTACT_LIST_REQUEST; extern const char *MSN_CONTACT_ADD_REQUEST; extern const char *MSN_CONTACT_UPDATE_REQUEST; Index: msn.c =================================================================== RCS file: /cvsroot/ayttm/ayttm/modules/msn2/libmsn2/msn.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- msn.c 30 Aug 2009 14:55:58 -0000 1.6 +++ msn.c 30 Aug 2009 19:37:33 -0000 1.7 @@ -68,10 +68,17 @@ void msn_account_cancel_connect(MsnAccount *ma) { + LList *l; + msn_connection_free(ma->ns_connection); ma->ns_connection = NULL; - l_list_foreach(ma->connections, (LListFunc)msn_connection_free, NULL); + for(l = ma->connections; l; l = l_list_next(l)) { + MsnConnection *con = l->data; + /* HTTP connections clean up themselves. Don't bother. */ + if(con->type != MSN_CONNECTION_HTTP) + msn_connection_free(con); + } } |
From: Siddhesh P. <sid...@us...> - 2009-08-30 14:56:11
|
Update of /cvsroot/ayttm/ayttm/modules/aim-oscar In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv25071/modules/aim-oscar Modified Files: aim-oscar.c Log Message: * CORE: get_state and get_status return const strings from modules in most cases. updated function signature accordingly * MSN: Conferencing and juggling between switchboards * MSN: Added missing functions and fixed warnings * MSN: Messaging improvements Index: aim-oscar.c =================================================================== RCS file: /cvsroot/ayttm/ayttm/modules/aim-oscar/aim-oscar.c,v retrieving revision 1.30 retrieving revision 1.31 diff -u -r1.30 -r1.31 --- aim-oscar.c 13 Aug 2009 20:20:37 -0000 1.30 +++ aim-oscar.c 30 Aug 2009 14:55:58 -0000 1.31 @@ -2114,7 +2114,7 @@ } -static gchar * +static const gchar * ay_aim_get_status_string (eb_account *account) { static gchar string[255], buf[255]; |
From: Siddhesh P. <sid...@us...> - 2009-08-30 14:56:11
|
Update of /cvsroot/ayttm/ayttm/modules/jabber In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv25071/modules/jabber Modified Files: jabber.c Log Message: * CORE: get_state and get_status return const strings from modules in most cases. updated function signature accordingly * MSN: Conferencing and juggling between switchboards * MSN: Added missing functions and fixed warnings * MSN: Messaging improvements Index: jabber.c =================================================================== RCS file: /cvsroot/ayttm/ayttm/modules/jabber/jabber.c,v retrieving revision 1.57 retrieving revision 1.58 diff -u -r1.57 -r1.58 --- jabber.c 30 Aug 2009 13:55:35 -0000 1.57 +++ jabber.c 30 Aug 2009 14:55:58 -0000 1.58 @@ -685,13 +685,13 @@ return jabber_away_xpm; } -static char *eb_jabber_get_status_string(eb_account *account) +static const char *eb_jabber_get_status_string(eb_account *account) { eb_jabber_account_data *jad = account->protocol_account_data; return jad->description ? jad->description : jabber_state_strings[0]; } -static char *eb_jabber_get_state_string(eb_account *account) +static const char *eb_jabber_get_state_string(eb_account *account) { eb_jabber_account_data *jad = account->protocol_account_data; |
From: Siddhesh P. <sid...@us...> - 2009-08-30 14:56:10
|
Update of /cvsroot/ayttm/ayttm In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv25071 Modified Files: ChangeLog Log Message: * CORE: get_state and get_status return const strings from modules in most cases. updated function signature accordingly * MSN: Conferencing and juggling between switchboards * MSN: Added missing functions and fixed warnings * MSN: Messaging improvements Index: ChangeLog =================================================================== RCS file: /cvsroot/ayttm/ayttm/ChangeLog,v retrieving revision 1.812 retrieving revision 1.813 diff -u -r1.812 -r1.813 --- ChangeLog 30 Aug 2009 14:09:09 -0000 1.812 +++ ChangeLog 30 Aug 2009 14:55:57 -0000 1.813 @@ -1,3 +1,21 @@ +* Sun Aug 30 2009 14:55 UTC [siddheshp] 0.5.0-138 +- ChangeLog, configure.ac, modules/aim-oscar/aim-oscar.c, modules/irc/irc.c, +modules/irc/irc.h, modules/jabber/jabber.c, modules/msn2/msn.c, +modules/msn2/libmsn2/msn-account.h, modules/msn2/libmsn2/msn-commands.c, +modules/msn2/libmsn2/msn-connection.c, modules/msn2/libmsn2/msn-connection.h, +modules/msn2/libmsn2/msn-contacts.c, modules/msn2/libmsn2/msn-contacts.h, +modules/msn2/libmsn2/msn-ext.h, modules/msn2/libmsn2/msn-http.c, +modules/msn2/libmsn2/msn-login.c, modules/msn2/libmsn2/msn-message.c, +modules/msn2/libmsn2/msn-message.h, modules/msn2/libmsn2/msn-sb.c, +modules/msn2/libmsn2/msn-sb.h, modules/msn2/libmsn2/msn.c, +modules/yahoo2/yahoo.c, src/chat_room.c, src/chat_window.c, src/chat_window.h, +src/message_parse.c, src/message_parse.h, src/service.h, src/status.c: + * CORE: get_state and get_status return const strings from modules in most + cases. updated function signature accordingly + * MSN: Conferencing and juggling between switchboards + * MSN: Added missing functions and fixed warnings + * MSN: Messaging improvements + * Sun Aug 30 2009 13:58 UTC [pstef] 0.5.0-137 - ChangeLog, configure.ac, modules/jabber/jabber.c, modules/jabber/libEBjabber.c, modules/jabber/libEBjabber.h, src/chat_room.c, |
From: Siddhesh P. <sid...@us...> - 2009-08-30 14:56:09
|
Update of /cvsroot/ayttm/ayttm/modules/msn2/libmsn2 In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv25071/modules/msn2/libmsn2 Modified Files: msn-account.h msn-commands.c msn-connection.c msn-connection.h msn-contacts.c msn-contacts.h msn-ext.h msn-http.c msn-login.c msn-message.c msn-message.h msn-sb.c msn-sb.h msn.c Log Message: * CORE: get_state and get_status return const strings from modules in most cases. updated function signature accordingly * MSN: Conferencing and juggling between switchboards * MSN: Added missing functions and fixed warnings * MSN: Messaging improvements Index: msn-account.h =================================================================== RCS file: /cvsroot/ayttm/ayttm/modules/msn2/libmsn2/msn-account.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- msn-account.h 24 Aug 2009 12:12:11 -0000 1.5 +++ msn-account.h 30 Aug 2009 14:55:58 -0000 1.6 @@ -125,8 +125,9 @@ void msn_account_free(MsnAccount *ma); void msn_account_cancel_connect(MsnAccount *ma); -void msn_set_initial_presence(MsnAccount *ma, int state); +MsnConnection *msn_account_get_sb_with_session_id(MsnAccount *ma, char *session_id); +void msn_set_initial_presence(MsnAccount *ma, int state); void msn_set_state(MsnAccount *ma, int state); #endif Index: msn-commands.c =================================================================== RCS file: /cvsroot/ayttm/ayttm/modules/msn2/libmsn2/msn-commands.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- msn-commands.c 24 Aug 2009 12:12:11 -0000 1.5 +++ msn-commands.c 30 Aug 2009 14:55:58 -0000 1.6 @@ -78,6 +78,9 @@ static void msn_command_got_PRP (MsnConnection *mc); static void msn_command_got_BYE (MsnConnection *mc); +static void msn_command_got_ACK (MsnConnection *mc); +static void msn_command_got_NAK (MsnConnection *mc); + static void msn_command_parse_payload_MSG (MsnMessage *msg); static void msn_command_parse_payload_GCF (MsnMessage *msg); static void msn_command_parse_payload_QRY (MsnMessage *msg); @@ -141,7 +144,9 @@ { "CAL", MSN_COMMAND_CAL, 2, 0, msn_command_got_CAL, NULL }, { "JOI", MSN_COMMAND_JOI, 2, 0, msn_command_got_JOI, NULL }, { "BYE", MSN_COMMAND_BYE, 0, 0, msn_command_got_BYE, NULL }, - { "PRP", MSN_COMMAND_PRP, 3, 0, msn_command_got_PRP, NULL } + { "PRP", MSN_COMMAND_PRP, 3, 0, msn_command_got_PRP, NULL }, + { "ACK", MSN_COMMAND_ACK, 0, 0, msn_command_got_ACK, NULL }, + { "NAK", MSN_COMMAND_NAK, 0, 0, msn_command_got_NAK, NULL } } ; @@ -411,6 +416,13 @@ return; } + if(!strcmp(payload_info->names[i], "Content-Type")) { + /* Not interested in non-IM messages right now */ + if(strncmp(payload_info->values[i], "text/plain;", 11)) + return; + } + + if(!strcmp(payload_info->names[i], "X-MMS-IM-Format")) { char *top, *start = NULL, *end = NULL; im = m_new0(MsnIM, 1); @@ -498,8 +510,10 @@ if(l && bud) ext_got_IM(mc, im, bud); - else + else { printf("%s is trying to message me despite not being in my list\n", nick); + ext_got_unknown_IM(mc, im, nick); + } free(im->body); free(im->color); @@ -669,6 +683,7 @@ static void msn_command_got_RNG (MsnConnection *mc) { MsnBuddy *bud; + int do_connect = 1; LList *buds = mc->account->buddies; char *nick = mc->current_message->argv[5]; @@ -683,10 +698,13 @@ } /* TODO Get confirmation from the user to know if she would like to chat with someone unknown */ - if(!buds) + if(!buds) { + do_connect = ext_confirm_invitation(mc, nick); bud = NULL; + } - msn_connect_sb_with_info(mc, nick, bud); + if(do_connect) + msn_connect_sb_with_info(mc, nick, bud); } @@ -737,3 +755,15 @@ } +static void msn_command_got_ACK (MsnConnection *mc) +{ + +} + + +static void msn_command_got_NAK (MsnConnection *mc) +{ + +} + + Index: msn-connection.c =================================================================== RCS file: /cvsroot/ayttm/ayttm/modules/msn2/libmsn2/msn-connection.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- msn-connection.c 24 Aug 2009 12:12:11 -0000 1.4 +++ msn-connection.c 30 Aug 2009 14:55:58 -0000 1.5 @@ -31,7 +31,8 @@ typedef struct { int trid; - MsnCommandHandler handler; + MsnCallbackHandler handler; + void *data; } MsnCallback; @@ -51,13 +52,13 @@ free(mc); } -void msn_connection_push_callback(MsnConnection *mc, MsnCommandHandler handler) +void msn_connection_push_callback(MsnConnection *mc, MsnCallbackHandler handler, void *data) { MsnCallback *cb = m_new0(MsnCallback, 1); cb->trid = mc->trid; - cb->handler = handler; + cb->data = data; mc->callbacks = l_list_append(mc->callbacks, cb); } @@ -78,7 +79,7 @@ MsnCallback *cb = l->data; if ( cb->trid == cur_trid ) { mc->callbacks = l_list_remove(mc->callbacks, cb); - cb->handler(mc); + cb->handler(mc, cb->data); return 1; } l = l_list_next(l); Index: msn-connection.h =================================================================== RCS file: /cvsroot/ayttm/ayttm/modules/msn2/libmsn2/msn-connection.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- msn-connection.h 24 Aug 2009 12:12:11 -0000 1.3 +++ msn-connection.h 30 Aug 2009 14:55:58 -0000 1.4 @@ -76,7 +76,9 @@ typedef void (*MsnConnectionCallback)(MsnConnection *mc); -void msn_connection_push_callback(MsnConnection *mc, MsnCommandHandler handle); +typedef void (*MsnCallbackHandler)(MsnConnection *mc, void *data); + +void msn_connection_push_callback(MsnConnection *mc, MsnCallbackHandler handle, void *data); int msn_connection_pop_callback(MsnConnection *mc); #define msn_connection_new() ( m_new0(MsnConnection, 1) ) Index: msn-contacts.c =================================================================== RCS file: /cvsroot/ayttm/ayttm/modules/msn2/libmsn2/msn-contacts.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- msn-contacts.c 24 Aug 2009 12:12:11 -0000 1.5 +++ msn-contacts.c 30 Aug 2009 14:55:58 -0000 1.6 @@ -78,13 +78,13 @@ } -void msn_got_initial_adl_response(MsnConnection *mc) +void msn_got_initial_adl_response(MsnConnection *mc, void *data) { ext_msn_contacts_synced(mc->account); } -void msn_got_initial_fqy_response(MsnConnection *mc) +void msn_got_initial_fqy_response(MsnConnection *mc, void *data) { MsnMessage *msg = mc->current_message; char out[MAX_ADL_SIZE], bufsize[5]; @@ -143,7 +143,7 @@ sprintf(bufsize, "%d", offset+5); msn_message_send(mc, out, MSN_COMMAND_ADL, bufsize); - msn_connection_push_callback(mc, msn_got_initial_adl_response); + msn_connection_push_callback(mc, msn_got_initial_adl_response, NULL); } @@ -218,7 +218,7 @@ else if ( cur_type != a->type ) { snprintf(buf+offset, sizeof(buf)-offset, "</d></ml>"); - snprintf(bufsize, sizeof(bufsize), "%d", strlen(buf)); + snprintf(bufsize, sizeof(bufsize), "%d", (int)strlen(buf)); if(cur_type == MSN_BUDDY_PASSPORT) msn_message_send(ma->ns_connection, buf, MSN_COMMAND_ADL, bufsize); @@ -251,14 +251,14 @@ if(count) { snprintf(buf+offset, sizeof(buf)-offset, "</d></ml>"); - snprintf(bufsize, sizeof(bufsize), "%d", strlen(buf)); + snprintf(bufsize, sizeof(bufsize), "%d", (int)strlen(buf)); if(cur_type == MSN_BUDDY_PASSPORT) msn_message_send(ma->ns_connection, buf, MSN_COMMAND_ADL, bufsize); else msn_message_send(ma->ns_connection, buf, MSN_COMMAND_FQY, bufsize); } - msn_connection_push_callback(ma->ns_connection, msn_got_initial_adl_response); + msn_connection_push_callback(ma->ns_connection, msn_got_initial_adl_response, NULL); } @@ -678,7 +678,7 @@ { MsnBuddy *bud = cbdata; - ext_msn_buddy_unblock_response(ma, error, bud); + ext_buddy_unblock_response(ma, error, bud); bud->list = MSN_BUDDY_ALLOW; } @@ -702,7 +702,7 @@ { MsnBuddy *bud = cbdata; - ext_msn_buddy_unblock_response(ma, error, bud); + ext_buddy_block_response(ma, error, bud); bud->list = MSN_BUDDY_BLOCK; } @@ -884,7 +884,7 @@ MsnBuddy *bud = cbdata; if(!strstr(data, "<ABGroupContactDeleteResponse")) - ext_buddy_group_add_failed(ma, bud, bud->group); + ext_buddy_group_remove_failed(ma, bud, bud->group); } @@ -1037,7 +1037,7 @@ } -void msn_buddy_add_to_group(MsnAccount *ma, MsnGroup *group, void *data) +static void msn_buddy_add_to_group(MsnAccount *ma, MsnGroup *group, void *data) { MsnBuddy *bud = data; @@ -1131,3 +1131,9 @@ } +void msn_buddy_invite(MsnConnection *mc, const char *passport) +{ + msn_message_send(mc, NULL, MSN_COMMAND_CAL, passport); +} + + Index: msn-contacts.h =================================================================== RCS file: /cvsroot/ayttm/ayttm/modules/msn2/libmsn2/msn-contacts.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- msn-contacts.h 24 Aug 2009 12:12:11 -0000 1.4 +++ msn-contacts.h 30 Aug 2009 14:55:58 -0000 1.5 @@ -29,8 +29,21 @@ void msn_buddy_add(MsnAccount *ma, const char *passport, const char *friendlyname, const char *grp); void msn_buddy_allow(MsnAccount *ma, MsnBuddy *bud); +void msn_buddy_remove(MsnAccount *ma, MsnBuddy *bud); +void msn_buddy_block(MsnAccount *ma, MsnBuddy *bud); +void msn_buddy_unblock(MsnAccount *ma, MsnBuddy *bud); + +void msn_buddy_invite(MsnConnection *mc, const char *passport); + void msn_buddy_remove_pending(MsnAccount *ma, MsnBuddy *bud); void msn_group_add(MsnAccount *ma, const char *groupname); +void msn_change_buddy_group(MsnAccount *ma, MsnBuddy *bud, MsnGroup *newgrp); +void msn_add_buddy_to_group(MsnAccount *ma, MsnBuddy *bud, MsnGroup *newgrp); +void msn_remove_buddy_from_group(MsnAccount *ma, MsnBuddy *bud); +void msn_group_mod(MsnAccount *ma, MsnGroup *group, const char *groupname); +void msn_group_del(MsnAccount *ma, MsnGroup *group); +void msn_group_add(MsnAccount *ma, const char *groupname); + #endif Index: msn-ext.h =================================================================== RCS file: /cvsroot/ayttm/ayttm/modules/msn2/libmsn2/msn-ext.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- msn-ext.h 24 Aug 2009 12:12:11 -0000 1.6 +++ msn-ext.h 30 Aug 2009 14:55:58 -0000 1.7 @@ -48,15 +48,27 @@ void ext_got_buddy_status(MsnConnection *mc, MsnBuddy *bud); void ext_buddy_joined_chat(MsnConnection *mc, char *passport, char *friendlyname); void ext_buddy_left(MsnConnection *mc, const char *passport); +void ext_buddy_removed(MsnAccount *ma, const char *bud); + +void ext_buddy_unblock_response(MsnAccount *ma, int error, MsnBuddy *buddy); +void ext_buddy_block_response(MsnAccount *ma, int error, MsnBuddy *buddy); +void ext_buddy_group_remove_failed(MsnAccount *ma, MsnBuddy *bud, MsnGroup *group); +void ext_buddy_group_add_failed(MsnAccount *ma, MsnBuddy *bud, MsnGroup *group); +void ext_group_add_failed(MsnAccount *ma, const char *group, char *error); +void ext_buddy_add_failed(MsnAccount *ma, const char *passport, char *friendlyname); void ext_got_status_change(MsnAccount *ma); void ext_update_friendlyname(MsnConnection *mc); void ext_got_IM_sb(MsnConnection *mc, MsnBuddy *bud); void ext_got_IM(MsnConnection *mc, MsnIM *im, MsnBuddy *bud); +void ext_got_unknown_IM(MsnConnection *mc, MsnIM *im, const char *bud); void ext_got_typing(MsnConnection *mc, MsnBuddy *bud); void ext_got_ans(MsnConnection *mc); +void ext_new_sb(MsnConnection *mc); + +int ext_confirm_invitation(MsnConnection *mc, const char *buddy); #endif Index: msn-http.c =================================================================== RCS file: /cvsroot/ayttm/ayttm/modules/msn2/libmsn2/msn-http.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- msn-http.c 24 Aug 2009 12:12:11 -0000 1.4 +++ msn-http.c 30 Aug 2009 14:55:58 -0000 1.5 @@ -25,6 +25,7 @@ #include "msn-http.h" #include "msn-connection.h" #include "msn-util.h" +#include "msn-ext.h" #include "llist.h" Index: msn-login.c =================================================================== RCS file: /cvsroot/ayttm/ayttm/modules/msn2/libmsn2/msn-login.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- msn-login.c 24 Aug 2009 12:12:11 -0000 1.6 +++ msn-login.c 30 Aug 2009 14:55:58 -0000 1.7 @@ -53,7 +53,7 @@ /* MSN Protocol Connection Explained inline. Start from the bottom */ /* 8) Got the final USR response. Either we're in or we're out */ -static void msn_got_final_usr_response(MsnConnection *mc) +static void msn_got_final_usr_response(MsnConnection *mc, void *data) { MsnAccount *ma = mc->account; @@ -82,7 +82,7 @@ ma->ticket, mash); - msn_connection_push_callback(ma->ns_connection, msn_got_final_usr_response); + msn_connection_push_callback(ma->ns_connection, msn_got_final_usr_response, NULL); } @@ -344,7 +344,7 @@ /* 4) If the NS is not busy it will ask us to go ahead for the Tweener * else it will XFR us to another server where we will restart from 1) */ -static void msn_got_usr_response(MsnConnection *mc) +static void msn_got_usr_response(MsnConnection *mc, void *data) { if ( mc->current_message->command == MSN_COMMAND_XFR ) { /* Update the IP address and port and connect to the other place */ @@ -389,17 +389,17 @@ } /* 3) Send a USR with our passport */ -static void msn_got_client_info_response ( MsnConnection *mc ) +static void msn_got_client_info_response ( MsnConnection *mc, void *data ) { /* We don't care what msn recommends... Ayttm is teh rul3z!!!!111oneone */ msn_message_send ( mc, NULL, MSN_COMMAND_USR, 3, MSN_AUTH_SSO, MSN_AUTH_INITIAL, mc->account->passport ); - msn_connection_push_callback(mc, msn_got_usr_response); + msn_connection_push_callback(mc, msn_got_usr_response, NULL); } /* 2) Send CVR with our MSN client information */ -static void msn_got_version_response(MsnConnection *mc) +static void msn_got_version_response(MsnConnection *mc, void *data) { if( mc->current_message->argc < 3 || strcmp(mc->current_message->argv[2], MSN_PROTOCOL_VERSION) ) { ext_msn_login_response(mc->account, MSN_LOGIN_FAIL_VER); @@ -424,7 +424,7 @@ MSN_OFFICIAL_CLIENT, mc->account->passport ); - msn_connection_push_callback(mc, msn_got_client_info_response); + msn_connection_push_callback(mc, msn_got_client_info_response, NULL); } /* 1) Send VER with our MSN client version */ @@ -432,7 +432,7 @@ { msn_message_send(mc, NULL, MSN_COMMAND_VER, MSN_PROTOCOL_VERSION, MSN_PROTO_CVR0); - msn_connection_push_callback(mc, msn_got_version_response); + msn_connection_push_callback(mc, msn_got_version_response, NULL); } /* 0) We obviously begin with a connection to the server */ @@ -471,9 +471,9 @@ ma->status = MSN_STATE_OFFLINE; - l_list_foreach(ma->connections, msn_connection_free, NULL); + l_list_foreach(ma->connections, (LListFunc)msn_connection_free, NULL); - l_list_foreach(ma->buddies, msn_buddy_reset, NULL); + l_list_foreach(ma->buddies, (LListFunc)msn_buddy_reset, NULL); } Index: msn-message.c =================================================================== RCS file: /cvsroot/ayttm/ayttm/modules/msn2/libmsn2/msn-message.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- msn-message.c 24 Aug 2009 12:12:11 -0000 1.6 +++ msn-message.c 30 Aug 2009 14:55:58 -0000 1.7 @@ -268,19 +268,68 @@ } -void msn_message_check_ack(MsnConnection *mc) +typedef struct { + MsnBuddy *bud; + MsnIM *im; +} MsnAckData; +static void msn_send_sb_IM(MsnConnection *sb, int error, void *data); + + +static void msn_buddy_is_back(MsnConnection *mc, void *data) { - if(!strcmp(mc->current_message->argv[0], "NACK")) - ext_show_warning(mc->account, MSN_MESSAGE_DELIVERY_FAILED); + MsnAckData *cbdata = data; + + if(mc->current_message->command == MSN_COMMAND_CAL) { + /* So that the subsequent JOI calls us */ + cbdata->bud->mq = l_list_append(cbdata->bud->mq, cbdata->im); + mc->sbpayload->data = cbdata->bud; + mc->sbpayload->callback = msn_send_sb_IM; + free(cbdata); + return; + } + else { + const MsnError *error = msn_strerror(MSN_MESSAGE_DELIVERY_FAILED); + ext_msn_error(mc, error); + free(cbdata->im); + free(cbdata); + } + +} + + +static void msn_message_check_ack(MsnConnection *mc, void *data) +{ + MsnAckData *cbdata = data; + + if(mc->current_message->command == MSN_COMMAND_NAK) { + /* Buddy disconnected himself from SB. Get him back */ + if(cbdata->bud) { + msn_buddy_invite(mc, cbdata->bud->passport); + msn_connection_push_callback(mc, msn_buddy_is_back, cbdata); + return; + } + else { + const MsnError *error = msn_strerror(MSN_MESSAGE_DELIVERY_FAILED); + ext_msn_error(mc, error); + } + } + + free(cbdata->im); + free(cbdata); } /* TODO Rich text messages */ -void msn_send_IM_to_sb(MsnConnection *sb, MsnIM *im) + +static void msn_send_IM_to_sb_real(MsnConnection *sb, MsnIM *im, MsnBuddy *bud) { char buf[2048]; char bufsize[5]; int len; + MsnAckData *cbdata = m_new0(MsnAckData, 1); + + cbdata->bud = bud; + cbdata->im = im; if(im->typing) len = snprintf(buf, sizeof(buf), "MIME-Version: 1.0\r\n" @@ -296,8 +345,13 @@ sprintf(bufsize, "%d", len); msn_message_send(sb, buf, MSN_COMMAND_MSG, 2, im->typing?MSN_MSG_NO_ACK:MSN_MSG_ACK_ALL, bufsize); - msn_connection_push_callback(sb, msn_message_check_ack); - free(im); + msn_connection_push_callback(sb, msn_message_check_ack, cbdata); +} + + +void msn_send_IM_to_sb(MsnConnection *sb, MsnIM *im) +{ + msn_send_IM_to_sb_real(sb, im, NULL); } @@ -307,7 +361,8 @@ LList *l; if(error) { - ext_show_warning(sb->account, MSN_MESSAGE_DELIVERY_FAILED); + const MsnError *error = msn_strerror(MSN_MESSAGE_DELIVERY_FAILED); + ext_msn_error(sb, error); return; } @@ -317,7 +372,7 @@ ext_got_IM_sb(sb, buddy); for(l = buddy->mq; l; l = l_list_remove(l, l->data) ) - msn_send_IM_to_sb(sb, (MsnIM *)l->data); + msn_send_IM_to_sb_real(sb, (MsnIM *)l->data, buddy); buddy->mq = NULL; } Index: msn-message.h =================================================================== RCS file: /cvsroot/ayttm/ayttm/modules/msn2/libmsn2/msn-message.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- msn-message.h 24 Aug 2009 12:12:11 -0000 1.5 +++ msn-message.h 30 Aug 2009 14:55:58 -0000 1.6 @@ -70,6 +70,8 @@ MSN_COMMAND_JOI = 31, MSN_COMMAND_BYE = 32, MSN_COMMAND_PRP = 33, + MSN_COMMAND_ACK = 34, + MSN_COMMAND_NAK = 35, MSN_COMMAND_COUNT } MsnCommand ; Index: msn-sb.c =================================================================== RCS file: /cvsroot/ayttm/ayttm/modules/msn2/libmsn2/msn-sb.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- msn-sb.c 24 Aug 2009 12:12:11 -0000 1.4 +++ msn-sb.c 30 Aug 2009 14:55:58 -0000 1.5 @@ -33,10 +33,16 @@ void msn_sb_got_join(MsnConnection *mc) { SBPayload *payload = mc->sbpayload; - payload->callback(mc, 0, payload->data); + + payload->num_members++; + + if(payload->callback) + payload->callback(mc, 0, payload->data); + + ext_buddy_joined_chat(mc, mc->current_message->argv[1], msn_urldecode(mc->current_message->argv[2])); } -static void msn_sb_got_usr_response(MsnConnection *mc) +static void msn_sb_got_usr_response(MsnConnection *mc, void *data) { SBPayload *payload = mc->sbpayload; MsnAccount *ma = mc->account; @@ -67,7 +73,7 @@ } -static void msn_sb_got_ans_response(MsnConnection *mc) +static void msn_sb_got_ans_response(MsnConnection *mc, void *data) { SBPayload *payload = mc->sbpayload; @@ -76,7 +82,7 @@ ext_buddy_joined_chat(mc, mc->current_message->argv[4], msn_urldecode(mc->current_message->argv[5])); - msn_connection_push_callback(mc, msn_sb_got_ans_response); + msn_connection_push_callback(mc, msn_sb_got_ans_response, NULL); } else if (mc->current_message->command == MSN_COMMAND_ANS) { ext_got_ans(mc); @@ -93,11 +99,12 @@ if(payload->incoming) { msn_message_send(mc, NULL, MSN_COMMAND_ANS, mc->account->passport, payload->challenge, payload->session_id); - msn_connection_push_callback(mc, msn_sb_got_ans_response); + msn_connection_push_callback(mc, msn_sb_got_ans_response, NULL); + ext_new_sb(mc); } else { msn_message_send(mc, NULL, MSN_COMMAND_USR, 2, mc->account->passport, payload->challenge); - msn_connection_push_callback(mc, msn_sb_got_usr_response); + msn_connection_push_callback(mc, msn_sb_got_usr_response, NULL); } free(payload->challenge); @@ -150,7 +157,7 @@ } -static void msn_got_sb_info(MsnConnection *mc) +static void msn_got_sb_info(MsnConnection *mc, void *data) { char *offset = NULL; SBPayload *payload = mc->sbpayload; @@ -178,7 +185,7 @@ ma->ns_connection->sbpayload = payload; msn_message_send(ma->ns_connection, NULL, MSN_COMMAND_XFR, 1, MSN_SB); - msn_connection_push_callback(ma->ns_connection, msn_got_sb_info); + msn_connection_push_callback(ma->ns_connection, msn_got_sb_info, NULL); } Index: msn-sb.h =================================================================== RCS file: /cvsroot/ayttm/ayttm/modules/msn2/libmsn2/msn-sb.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- msn-sb.h 24 Aug 2009 12:12:11 -0000 1.3 +++ msn-sb.h 30 Aug 2009 14:55:58 -0000 1.4 @@ -36,6 +36,7 @@ int num_members; int incoming; + int connected; } ; void msn_connect_sb(MsnAccount *ma, const char *host, int port); @@ -43,7 +44,7 @@ void msn_connect_sb_with_info(MsnConnection *mc, char *room_name, void *data); void msn_get_sb(MsnAccount *ma, char *room_name, void *data, SBCallback callback); -void msn_got_sb_join(MsnConnection *mc); +void msn_sb_got_join(MsnConnection *mc); void msn_sb_disconnect(MsnConnection *sb); void msn_sb_disconnected(MsnConnection *sb); Index: msn.c =================================================================== RCS file: /cvsroot/ayttm/ayttm/modules/msn2/libmsn2/msn.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- msn.c 24 Aug 2009 12:12:11 -0000 1.5 +++ msn.c 30 Aug 2009 14:55:58 -0000 1.6 @@ -71,7 +71,23 @@ msn_connection_free(ma->ns_connection); ma->ns_connection = NULL; - l_list_foreach(ma->connections, msn_connection_free, NULL); + l_list_foreach(ma->connections, (LListFunc)msn_connection_free, NULL); +} + + +MsnConnection *msn_account_get_sb_with_session_id(MsnAccount *ma, char *session_id) +{ + LList *con = ma->connections; + + while(con) { + MsnConnection *sb = con->data; + + if(!strcmp(session_id, sb->sbpayload->session_id)) + return sb; + con = l_list_next(con); + } + + return NULL; } |
From: Siddhesh P. <sid...@us...> - 2009-08-30 14:56:09
|
Update of /cvsroot/ayttm/ayttm/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv25071/src Modified Files: chat_room.c chat_window.c chat_window.h message_parse.c message_parse.h service.h status.c Log Message: * CORE: get_state and get_status return const strings from modules in most cases. updated function signature accordingly * MSN: Conferencing and juggling between switchboards * MSN: Added missing functions and fixed warnings * MSN: Messaging improvements Index: chat_room.c =================================================================== RCS file: /cvsroot/ayttm/ayttm/src/chat_room.c,v retrieving revision 1.81 retrieving revision 1.82 diff -u -r1.81 -r1.82 --- chat_room.c 30 Aug 2009 14:14:02 -0000 1.81 +++ chat_room.c 30 Aug 2009 14:55:58 -0000 1.82 @@ -1581,8 +1581,9 @@ void eb_join_chat_room(eb_chat_room *chat_room, int send_join) { - GtkWidget *vbox, *vbox2, *hbox, *hbox2, *label, *toolbar, *icon, *iconwid; + GtkWidget *vbox, *vbox2, *hbox, *hbox2, *label, *toolbar, *iconwid; GtkWidget *send_button, *close_button, *print_button, *separator; + GdkPixbuf *icon; GtkWidget *scrollwindow = gtk_scrolled_window_new(NULL, NULL); gboolean enableSoundButton = FALSE; GtkCellRenderer *renderer; Index: chat_window.c =================================================================== RCS file: /cvsroot/ayttm/ayttm/src/chat_window.c,v retrieving revision 1.91 retrieving revision 1.92 diff -u -r1.91 -r1.92 --- chat_window.c 30 Aug 2009 13:58:59 -0000 1.91 +++ chat_window.c 30 Aug 2009 14:55:58 -0000 1.92 @@ -1684,7 +1684,7 @@ remote_contact->chatwindow->preferred = remote_account; } -void eb_log_status_changed(eb_account *ea, gchar *status) +void eb_log_status_changed(eb_account *ea, const gchar *status) { char buff[BUF_SIZE]; time_t my_time = time(NULL); Index: chat_window.h =================================================================== RCS file: /cvsroot/ayttm/ayttm/src/chat_window.h,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- chat_window.h 30 Aug 2009 13:58:59 -0000 1.17 +++ chat_window.h 30 Aug 2009 14:55:58 -0000 1.18 @@ -126,7 +126,7 @@ void eb_chat_window_display_contact( struct contact * remote_contact ); void eb_chat_window_display_account( eb_account * remote_account ); void eb_chat_window_display_error( eb_account * remote, gchar * message ); -void eb_log_status_changed(eb_account *ea, gchar *status ); +void eb_log_status_changed(eb_account *ea, const gchar *status ); void eb_chat_window_do_timestamp( struct contact * c, gboolean online ); void eb_restore_last_conv(gchar *file_name, chat_window* cw); void send_message(GtkWidget *widget, gpointer d); Index: message_parse.c =================================================================== RCS file: /cvsroot/ayttm/ayttm/src/message_parse.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- message_parse.c 12 Jul 2009 10:12:38 -0000 1.13 +++ message_parse.c 30 Aug 2009 14:55:58 -0000 1.14 @@ -475,7 +475,7 @@ } void eb_update_status( eb_account * remote, - char * message ) + const char * message ) { char *buff = convert_to_utf8(message); Index: message_parse.h =================================================================== RCS file: /cvsroot/ayttm/ayttm/src/message_parse.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- message_parse.h 1 Apr 2003 07:25:16 -0000 1.1.1.1 +++ message_parse.h 30 Aug 2009 14:55:58 -0000 1.2 @@ -46,7 +46,7 @@ char * message ); void eb_update_status( eb_account * remote, - char * message ); + const char * message ); #ifdef __cplusplus } /* extern "C" */ #endif Index: service.h =================================================================== RCS file: /cvsroot/ayttm/ayttm/src/service.h,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- service.h 28 Aug 2009 11:30:34 -0000 1.14 +++ service.h 30 Aug 2009 14:55:58 -0000 1.15 @@ -125,8 +125,8 @@ this will get used on the Contact List, if statuses are not available, this should return the empty string */ - char *(*get_status_string)(eb_account * account); - char *(*get_state_string)(eb_account * account); + const char *(*get_status_string)(eb_account * account); + const char *(*get_state_string)(eb_account * account); const char **(*get_status_pixmap)(eb_account * account); const void **(*get_status_pixbuf)(eb_account *account); Index: status.c =================================================================== RCS file: /cvsroot/ayttm/ayttm/src/status.c,v retrieving revision 1.89 retrieving revision 1.90 diff -u -r1.89 -r1.90 --- status.c 28 Aug 2009 11:30:34 -0000 1.89 +++ status.c 30 Aug 2009 14:55:58 -0000 1.90 @@ -1479,7 +1479,8 @@ /* update the status info(pixmap and state) of an account */ void buddy_update_status(eb_account *ea) { - gchar *status, *state, *tmp, *c, buff[128], msgbuff[1024]; + const gchar *status, *state; + gchar *tmp, *c, buff[128], msgbuff[1024]; struct tm *mytime; time_t last_status_change; |
From: Siddhesh P. <sid...@us...> - 2009-08-30 14:56:09
|
Update of /cvsroot/ayttm/ayttm/modules/yahoo2 In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv25071/modules/yahoo2 Modified Files: yahoo.c Log Message: * CORE: get_state and get_status return const strings from modules in most cases. updated function signature accordingly * MSN: Conferencing and juggling between switchboards * MSN: Added missing functions and fixed warnings * MSN: Messaging improvements Index: yahoo.c =================================================================== RCS file: /cvsroot/ayttm/ayttm/modules/yahoo2/yahoo.c,v retrieving revision 1.113 retrieving revision 1.114 diff -u -r1.113 -r1.114 --- yahoo.c 29 Aug 2009 19:26:40 -0000 1.113 +++ yahoo.c 30 Aug 2009 14:55:58 -0000 1.114 @@ -3032,7 +3032,7 @@ return yahoo_online_xpm; } -static char *eb_yahoo_get_status_string(eb_account * ea) +static const char *eb_yahoo_get_status_string(eb_account * ea) { eb_yahoo_account_data *yad = ea->protocol_account_data; int i; |
From: Siddhesh P. <sid...@us...> - 2009-08-30 14:56:08
|
Update of /cvsroot/ayttm/ayttm/modules/msn2 In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv25071/modules/msn2 Modified Files: msn.c Log Message: * CORE: get_state and get_status return const strings from modules in most cases. updated function signature accordingly * MSN: Conferencing and juggling between switchboards * MSN: Added missing functions and fixed warnings * MSN: Messaging improvements Index: msn.c =================================================================== RCS file: /cvsroot/ayttm/ayttm/modules/msn2/msn.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- msn.c 20 Aug 2009 12:07:01 -0000 1.6 +++ msn.c 30 Aug 2009 14:55:58 -0000 1.7 @@ -110,8 +110,6 @@ } ay_msn_local_account; -static eb_chat_room * ay_msn_get_chat_room(MsnConnection *con); -static void ay_msn_clean_up_chat_room(MsnConnection *con); static eb_account *ay_msn_new_account(eb_local_account *ela, const char * account ); static eb_account *ay_msn_new_account_for_buddy(eb_local_account *ela, MsnBuddy *buddy); @@ -127,7 +125,6 @@ static void ay_msn_format_message (MsnIM *msg); static char *ay_msn_get_color(void) { static char color[]="#aa0000"; return color; } static void ay_msn_change_group(eb_account * ea, const char *new_group); -static void ay_msn_real_change_group(eb_local_account *ela, eb_account * ea, const char *old_group, const char *new_group); static void invite_gnomemeeting(ebmCallbackData * data); static LList *ay_msn_get_smileys(void) { return psmileys; } @@ -156,9 +153,9 @@ struct service SERVICE_INFO = { "MSN", -1, - SERVICE_CAN_OFFLINEMSG | +/* SERVICE_CAN_OFFLINEMSG | */ SERVICE_CAN_GROUPCHAT | - SERVICE_CAN_FILETRANSFER | +/* SERVICE_CAN_FILETRANSFER | */ SERVICE_CAN_MULTIACCOUNT, NULL }; @@ -531,11 +528,12 @@ { "", "Hidden", "Busy", "Idle", "BRB", "Away", "Phone", "Lunch", "Offline"}; +/* TODO static void ay_html_to_im(MsnIM *msg) { } - +*/ static gboolean ay_msn_query_connected( eb_account * account ) { @@ -965,7 +963,7 @@ mlad = account->protocol_local_account_data; if(name && *name) - strcpy(ecr->room_name, name); + sprintf(ecr->room_name, "MSN Chat Room (#%s)", name); else sprintf(ecr->room_name, "MSN :: %s", mlad->ma->passport); @@ -991,30 +989,37 @@ } -void ext_got_ans(MsnConnection *mc) +void ext_new_sb(MsnConnection *mc) { MsnBuddy *bud; SBPayload *payload = mc->sbpayload; eb_chat_room *ecr = NULL; /* This should be a buddy */ - if(!(bud = payload->data)) - return; + bud = payload->data; - if(payload->num_members == 1) { + /* Create a chat room if the buddy already has an active switchboard with me */ + if(bud && !bud->sb) { bud->sb = mc; - ecr = ((eb_account *)bud->ext_data)->account_contact->chatwindow; + payload->data = NULL; } - else + else { ecr = ay_msn_find_chat_room(payload->session_id); + if(!ecr) + ecr = ay_msn_make_chat_room(payload->session_id, mc->account->ext_data, 0); - if(ecr) { - ecr->protocol_local_chat_room_data = mc; mc->sbpayload->data = ecr; + ecr->protocol_local_chat_room_data = mc; } } +void ext_got_ans(MsnConnection *mc) +{ + +} + + void ext_buddy_left(MsnConnection *mc, const char *passport) { SBPayload *payload = mc->sbpayload; @@ -1030,16 +1035,17 @@ SBPayload *payload = mc->sbpayload; eb_chat_room *ecr; - /* We're not interested in making a room for individual chat */ - if(payload->num_members == 1) - return; + /* We're not interested announcing arrivals in individual chat */ +/* if(payload->num_members == 1) + return;*/ ecr = ay_msn_find_chat_room(payload->session_id); - if(!ecr) +/* if(!ecr) ecr = ay_msn_make_chat_room(payload->session_id, mc->account->ext_data, 0); - - eb_chat_room_buddy_arrive(ecr, friendlyname, passport); +*/ + if(ecr) + eb_chat_room_buddy_arrive(ecr, friendlyname, passport); } @@ -1130,7 +1136,7 @@ int i=0; for(i=0; i<MSN_STATES_COUNT; i++) - list = l_list_append( list, ay_msn_status_strings[i][0]?ay_msn_status_strings[i]:"Online" ); + list = l_list_append( list, (void *)(ay_msn_status_strings[i][0]?ay_msn_status_strings[i]:"Online") ); return list; } @@ -1256,7 +1262,7 @@ } -static char * ay_msn_get_status_string( eb_account * account ) +static const char * ay_msn_get_status_string( eb_account * account ) { MsnBuddy * mad = (MsnBuddy *)account->protocol_account_data; @@ -1282,11 +1288,22 @@ static void ay_msn_send_chat_room_message( eb_chat_room * room, gchar * mess ) { MsnIM *im = m_new0(MsnIM, 1); + MsnConnection *sb = room->protocol_local_chat_room_data; + eb_local_account *ela; + + if(!sb) { + eb_debug(DBG_MSN, "No Switchboard!\n"); + return; + } + + ela= sb->account->ext_data; im->body = strdup(mess); - if(room->protocol_local_chat_room_data) - msn_send_IM_to_sb(room->protocol_local_chat_room_data, im); + msn_send_IM_to_sb(sb, im); + + /* We don't get the message back in msn */ + eb_chat_room_show_message(room, ela->alias, mess); } @@ -1303,6 +1320,73 @@ } +void ext_buddy_unblock_response(MsnAccount *ma, int error, MsnBuddy *buddy) +{ + if(error) { + char buf[1024]; + + snprintf(buf, sizeof(buf), _("Could not unblock <i>%s</i>. Server returned an error."), buddy->passport); + + ay_do_warning(_("MSN"), buf); + } +} + + +void ext_buddy_block_response(MsnAccount *ma, int error, MsnBuddy *buddy) +{ + if(error) { + char buf[1024]; + + snprintf(buf, sizeof(buf), _("Could not block <i>%s</i>. Server returned an error."), buddy->passport); + + ay_do_warning(_("MSN"), buf); + } +} + + +void ext_buddy_group_remove_failed(MsnAccount *ma, MsnBuddy *bud, MsnGroup *group) +{ + char buf[1024]; + + snprintf(buf, sizeof(buf), _("Could not remove <i>%s</i> from group <i>%s</i>.\nServer returned an error."), + bud->passport, group->name); + + ay_do_warning(_("MSN"), buf); +} + + +void ext_buddy_group_add_failed(MsnAccount *ma, MsnBuddy *bud, MsnGroup *group) +{ + char buf[1024]; + + snprintf(buf, sizeof(buf), _("Could not add <i>%s</i> to group <i>%s</i>.\nServer returned an error."), + bud->passport, group->name); + + ay_do_warning(_("MSN"), buf); +} + + +void ext_group_add_failed(MsnAccount *ma, const char *group, char *msg) +{ + char buf[1024]; + + snprintf(buf, sizeof(buf), _("Unable to add group <b>%s</b>. Server returned error:\n\n<i>%s</i>"), + group, msg?msg:_("Unknown error")); + + ay_do_warning(_("MSN"), buf); +} + + +void ext_buddy_add_failed(MsnAccount *ma, const char *passport, char *friendlyname) +{ + char buf[1024]; + + snprintf(buf, sizeof(buf), _("Could not add buddy %s(<i>%s</i>). Server returned an error."), passport, friendlyname); + + ay_do_warning(_("MSN"), buf); +} + + static int ay_msn_authorize_user( eb_local_account *ela, MsnBuddy *bud ) { char buff[1024]; @@ -1326,15 +1410,64 @@ } +static void ay_msn_invite_callback(MsnConnection *sb, int error, void *data) +{ + eb_chat_room *room = data; + + if(error) { + const MsnError *err = msn_strerror(error); + ext_msn_error(sb, err); + room->protocol_local_chat_room_data = NULL; + return; + } + + sprintf(room->room_name, "MSN Chat Room (#%s)", sb->sbpayload->session_id); + strcpy(room->id, room->room_name); + + room->protocol_local_chat_room_data = sb; + sb->sbpayload->data = room; +} + + static void ay_msn_send_invite( eb_local_account * account, eb_chat_room * room, char * user, const char * message ) { - if (!room->protocol_local_chat_room_data) { - ay_do_warning( _("MSN Warning"), _("Cannot invite user: connection to the chatroom has been closed.")); + MsnConnection *mc; + + /* Get switchboard if we don't have one */ + if (!(mc = room->protocol_local_chat_room_data)) { + ay_msn_local_account *mlad = account->protocol_local_account_data; + + msn_get_sb(mlad->ma, user, room, ay_msn_invite_callback); + /* HACK! we're pointing to the NS connection till our SB is ready so that + * we don't keep requesting a new one for every invite*/ + room->protocol_local_chat_room_data = mlad->ma->ns_connection; return; } + while(mc->type != MSN_CONNECTION_SB) { + gtk_main_iteration(); + mc = room->protocol_local_chat_room_data; + + /* Our SB connection failed. Cry. */ + if(!mc) { + ay_do_error(_("MSN Invitation"), _("Invite failed!")); + return; + } + } + /* Invite */ + msn_buddy_invite(room->protocol_local_chat_room_data, user); +} + + +int ext_confirm_invitation(MsnConnection *mc, const char *buddy) +{ + char msgbuf[1024]; + + snprintf(msgbuf, sizeof(msgbuf), _("%s has invited you to chat.\nDo you want to accept?"), buddy); + + return eb_do_confirm_dialog(msgbuf, _("MSN Chat Invitation")); } @@ -1393,15 +1526,6 @@ } -void ext_group_add_failed(MsnAccount *ma, const char *group, const char *msg) -{ - char buf[1024]; - - snprintf(buf, sizeof(buf), _("Unable to add group <b>%s</b>. Server returned error:\n\n<i>%s</i>"), - group, msg?msg:_("Unknown error")); -} - - static void ay_msn_add_group(eb_local_account *ela, const char *group) { ay_msn_local_account *mlad = ela->protocol_local_account_data; @@ -1668,21 +1792,50 @@ } -static eb_chat_room * ay_msn_get_chat_room(MsnConnection *con) +static void ay_msn_join_chat_room(eb_chat_room *ecr) { - return NULL; + } -static void ay_msn_join_chat_room(eb_chat_room *ecr) +void ext_got_unknown_IM(MsnConnection *mc, MsnIM *msg, const char *sender) { + eb_chat_room * ecr=mc->sbpayload->data; + + eb_account *ea = NULL; + char *local_account_name=NULL; + eb_local_account *ela=NULL; + + /* format message */ + ay_msn_format_message (msg); + /* The username element is always valid, even if it's not an SB */ + local_account_name=mc->account->passport; + ela = find_local_account_by_handle(local_account_name, SERVICE_INFO.protocol_id); + + if(!ela) { + eb_debug(DBG_MSN, "Unable to find local account by handle: %s\n", local_account_name); + return; + } + + if(ecr!=NULL) + eb_chat_room_show_message(ecr, sender, msg->body); + else { + ea = g_new0(eb_account, 1); + strncpy(ea->handle, sender, 255); + ea->service_id = ela->service_id; + ea->ela = ela; + + add_dummy_contact(sender, ea); + + eb_parse_incoming_message(ela, ea, msg->body); + } } void ext_got_IM(MsnConnection *mc, MsnIM *msg, MsnBuddy *buddy) { - eb_chat_room * ecr=ay_msn_get_chat_room(mc); + eb_chat_room * ecr=mc->sbpayload->data; eb_account *sender = NULL; char *local_account_name=NULL; @@ -1916,9 +2069,11 @@ void msn_new_mail_run_script(eb_local_account *ela) { +/* ay_msn_local_account *mlad = (ay_msn_local_account *)ela->protocol_local_account_data; ay_exec(mlad->do_mail_notify_script_name); +*/ } |
From: Siddhesh P. <sid...@us...> - 2009-08-30 14:56:08
|
Update of /cvsroot/ayttm/ayttm/modules/irc In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv25071/modules/irc Modified Files: irc.c irc.h Log Message: * CORE: get_state and get_status return const strings from modules in most cases. updated function signature accordingly * MSN: Conferencing and juggling between switchboards * MSN: Added missing functions and fixed warnings * MSN: Messaging improvements Index: irc.c =================================================================== RCS file: /cvsroot/ayttm/ayttm/modules/irc/irc.c,v retrieving revision 1.58 retrieving revision 1.59 diff -u -r1.58 -r1.59 --- irc.c 13 Aug 2009 20:20:37 -0000 1.58 +++ irc.c 30 Aug 2009 14:55:58 -0000 1.59 @@ -842,7 +842,7 @@ return ea; } -static char *ay_irc_get_status_string(eb_account *account) +static const char *ay_irc_get_status_string(eb_account *account) { ay_irc_account *eia = (ay_irc_account *)account->protocol_account_data; static char string[255]; Index: irc.h =================================================================== RCS file: /cvsroot/ayttm/ayttm/modules/irc/irc.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- irc.h 13 Aug 2009 20:20:38 -0000 1.3 +++ irc.h 30 Aug 2009 14:55:58 -0000 1.4 @@ -114,7 +114,7 @@ static void ay_irc_del_user( eb_account * account ); static int ay_irc_is_suitable (eb_local_account *local, eb_account *remote); static eb_account * ay_irc_new_account(eb_local_account *ela, const char * account ); -static char * ay_irc_get_status_string( eb_account * account ); +static const char * ay_irc_get_status_string( eb_account * account ); static const char ** ay_irc_get_status_pixmap( eb_account * account); static void ay_irc_set_idle(eb_local_account * account, int idle ); static void ay_irc_set_away( eb_local_account * account, char * message, int away); |
From: Piotr S. <ps...@us...> - 2009-08-30 14:14:12
|
Update of /cvsroot/ayttm/ayttm/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv22448 Modified Files: chat_room.c Log Message: Brought back Siddhesh's changes Index: chat_room.c =================================================================== RCS file: /cvsroot/ayttm/ayttm/src/chat_room.c,v retrieving revision 1.80 retrieving revision 1.81 diff -u -r1.80 -r1.81 --- chat_room.c 30 Aug 2009 13:58:59 -0000 1.80 +++ chat_room.c 30 Aug 2009 14:14:02 -0000 1.81 @@ -106,6 +106,8 @@ { LList *history = NULL; + eb_debug(DBG_CORE, "Freeing chat room %p\n"); + if (!chat_room) return; @@ -527,7 +529,9 @@ third = find_account_by_handle(acc, ecr->local_user->service_id); if (third) { chat_window_to_chat_room(ecr, third, gtk_entry_get_text(GTK_ENTRY(ecr->invite_message))); + /* Why do we do this? It breaks stuff ecr->preferred = NULL; + */ } } else { acc = strstr(invited, "(")+1; |
From: Piotr S. <ps...@us...> - 2009-08-30 14:09:22
|
Update of /cvsroot/ayttm/ayttm In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv22173 Modified Files: ChangeLog configure.ac Log Message: * Jabber: Gmail Notifications support * Only raise window on particular regex. This closes #856326 Index: ChangeLog =================================================================== RCS file: /cvsroot/ayttm/ayttm/ChangeLog,v retrieving revision 1.811 retrieving revision 1.812 diff -u -r1.811 -r1.812 --- ChangeLog 29 Aug 2009 19:26:40 -0000 1.811 +++ ChangeLog 30 Aug 2009 14:09:09 -0000 1.812 @@ -1,3 +1,11 @@ +* Sun Aug 30 2009 13:58 UTC [pstef] 0.5.0-137 +- ChangeLog, configure.ac, modules/jabber/jabber.c, +modules/jabber/libEBjabber.c, modules/jabber/libEBjabber.h, src/chat_room.c, +src/chat_window.c, src/chat_window.h , src/prefs.c, src/prefs.c, +src/gtk/prefs_window.C: + * Jabber: Gmail Notifications support + * Only raise window on particular regex. This closes #856326 + * Sat Aug 29 2009 19:25 UTC [siddheshp] 0.5.0-136 - ChangeLog, configure.ac, modules/yahoo2/yahoo.c, modules/yahoo2/libyahoo2/libyahoo2.c, src/chat_room.c: @@ -7,7 +15,6 @@ * CORE: Fixed case where preferred account for a room would be reset when a chat room is cloned out of it - * Fri Aug 28 2009 11:30 UTC [pstef] 0.5.0-135 - ChangeLog, configure.ac, src/account.h, src/contact.h, src/service.h, src/status.c, src/util.c, modules/jabber/jabber.c, modules/yahoo2/yahoo.c: Index: configure.ac =================================================================== RCS file: /cvsroot/ayttm/ayttm/configure.ac,v retrieving revision 1.628 retrieving revision 1.629 diff -u -r1.628 -r1.629 --- configure.ac 29 Aug 2009 19:26:40 -0000 1.628 +++ configure.ac 30 Aug 2009 14:09:09 -0000 1.629 @@ -5,7 +5,7 @@ AC_PREREQ(2.53) AC_CONFIG_SRCDIR(src/main.c) AM_INIT_AUTOMAKE([1.6 dist-bzip2 dist-zip]) -RELEASE=136 +RELEASE=137 # This is to check modules/core binary compat # Bump it up when necessary only (query_callbacks change, struct change etc) |
From: Piotr S. <ps...@us...> - 2009-08-30 13:59:17
|
Update of /cvsroot/ayttm/ayttm/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv21533 Modified Files: chat_room.c chat_window.c chat_window.h prefs.c prefs.h Log Message: Only raise window on particular regex. This closes #856326 Index: chat_room.c =================================================================== RCS file: /cvsroot/ayttm/ayttm/src/chat_room.c,v retrieving revision 1.79 retrieving revision 1.80 diff -u -r1.79 -r1.80 --- chat_room.c 29 Aug 2009 19:26:40 -0000 1.79 +++ chat_room.c 30 Aug 2009 13:58:59 -0000 1.80 @@ -106,8 +106,6 @@ { LList *history = NULL; - eb_debug(DBG_CORE, "Freeing chat room %p\n"); - if (!chat_room) return; @@ -529,9 +527,7 @@ third = find_account_by_handle(acc, ecr->local_user->service_id); if (third) { chat_window_to_chat_room(ecr, third, gtk_entry_get_text(GTK_ENTRY(ecr->invite_message))); - /* Why do we do this? It breaks stuff ecr->preferred = NULL; - */ } } else { acc = strstr(invited, "(")+1; @@ -1441,7 +1437,7 @@ } if (!gtk_window_is_active(GTK_WINDOW(chat_room->window))) eb_chat_room_update_window_title(chat_room, TRUE); - if (iGetLocalPref("do_raise_window")) + if (should_window_raise(message)) gdk_window_raise(chat_room->window->window); if (chat_room->notebook) { int current_num = gtk_notebook_get_current_page(GTK_NOTEBOOK(chat_room->notebook)); Index: chat_window.c =================================================================== RCS file: /cvsroot/ayttm/ayttm/src/chat_window.c,v retrieving revision 1.90 retrieving revision 1.91 diff -u -r1.90 -r1.91 --- chat_window.c 26 Aug 2009 09:26:14 -0000 1.90 +++ chat_window.c 30 Aug 2009 13:58:59 -0000 1.91 @@ -34,6 +34,7 @@ #include <stdlib.h> #include <gdk/gdkkeysyms.h> #include <ctype.h> +#include <regex.h> #include "auto_complete.h" @@ -1341,6 +1342,28 @@ html_text_buffer_append(GTK_TEXT_VIEW(c->chatwindow->chat), buff, HTML_IGNORE_NONE); } +int should_window_raise(const char *message) +{ + if (iGetLocalPref("do_raise_window")) { + char *thepattern = cGetLocalPref("regex_pattern"); + + if (thepattern && thepattern[0]) { + regex_t myreg; + regmatch_t pmatch; + int rc = regcomp(&myreg, thepattern, REG_EXTENDED | REG_ICASE); + + if (!rc) { + rc = regexec(&myreg, message, 1, &pmatch, 0); + if (!rc) + return 1; + } + } + else + /* no pattern specified. Assume always. */ + return 1; + } + return 0; +} void eb_chat_window_display_remote_message(eb_local_account *account, eb_account *remote, gchar *o_message) @@ -1451,8 +1474,6 @@ set_tab_red(remote_contact->chatwindow); } - else if (iGetLocalPref("do_raise_window")) - gdk_window_show(remote_contact->chatwindow->window->window); if (!gtk_window_is_active(GTK_WINDOW(remote_contact->chatwindow->window))) EB_UPDATE_WINDOW_TITLE(remote_contact->chatwindow, TRUE); @@ -1466,9 +1487,9 @@ play_sound(SOUND_RECEIVE); } - /* for raising the window*/ - if (iGetLocalPref("do_raise_window")) - gdk_window_show(remote_contact->chatwindow->window->window); + /* for raising the window */ + if (should_window_raise(o_message)) + gdk_window_raise(remote_contact->chatwindow->window->window); if (iGetLocalPref("do_convo_timestamp")) { gchar *color; Index: chat_window.h =================================================================== RCS file: /cvsroot/ayttm/ayttm/src/chat_window.h,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- chat_window.h 24 Jul 2009 13:12:12 -0000 1.16 +++ chat_window.h 30 Aug 2009 13:58:59 -0000 1.17 @@ -121,8 +121,8 @@ void eb_chat_window_display_remote_message( eb_local_account * account, eb_account * remote, gchar * message); +int should_window_raise(const char *message); void eb_chat_window_display_status( eb_account * remote, gchar * message ); - void eb_chat_window_display_contact( struct contact * remote_contact ); void eb_chat_window_display_account( eb_account * remote_account ); void eb_chat_window_display_error( eb_account * remote, gchar * message ); Index: prefs.c =================================================================== RCS file: /cvsroot/ayttm/ayttm/src/prefs.c,v retrieving revision 1.43 retrieving revision 1.44 diff -u -r1.43 -r1.44 --- prefs.c 26 Aug 2009 09:26:14 -0000 1.43 +++ prefs.c 30 Aug 2009 13:58:59 -0000 1.44 @@ -677,6 +677,7 @@ iSetLocalPref( "do_ignore_unknown", 0 ); iSetLocalPref( "do_multi_line", 1 ); iSetLocalPref( "do_raise_window", 0 ); + cSetLocalPref( "regex_pattern", "" ); iSetLocalPref( "do_send_idle_time", 0 ); iSetLocalPref( "do_timestamp", 0 ); iSetLocalPref( "do_ignore_fore", 1 ); @@ -950,6 +951,7 @@ fprintf( fp, "do_ignore_unknown=%d\n", iGetLocalPref("do_ignore_unknown") ); fprintf( fp, "do_multi_line=%d\n", iGetLocalPref("do_multi_line") ); fprintf( fp, "do_raise_window=%d\n", iGetLocalPref("do_raise_window") ); + fprintf( fp, "regex_pattern=%s\n", cGetLocalPref("regex_pattern") ); fprintf( fp, "do_smiley=%d\n", iGetLocalPref("do_smiley") ); fprintf( fp, "do_send_idle_time=%d\n", iGetLocalPref("do_send_idle_time") ); fprintf( fp, "do_timestamp=%d\n", iGetLocalPref("do_timestamp") ); @@ -1046,7 +1048,8 @@ /* chat prefs */ prefs->chat.do_convo_timestamp = iGetLocalPref("do_convo_timestamp"); prefs->chat.do_ignore_unknown = iGetLocalPref("do_ignore_unknown"); - prefs->chat.do_raise_window = iGetLocalPref("do_raise_window"); + prefs->chat.do_raise_window = iGetLocalPref("do_raise_window"); + strncpy( prefs->chat.regex_pattern, cGetLocalPref("regex_pattern"), MAX_PREF_LEN ); prefs->chat.do_smiley = iGetLocalPref("do_smiley"); prefs->chat.do_send_idle_time = iGetLocalPref("do_send_idle_time"); prefs->chat.do_ignore_fore = iGetLocalPref("do_ignore_fore"); @@ -1209,6 +1212,7 @@ iSetLocalPref( "do_convo_timestamp", inPrefs->chat.do_convo_timestamp ); iSetLocalPref( "do_ignore_unknown", inPrefs->chat.do_ignore_unknown ); iSetLocalPref( "do_raise_window", inPrefs->chat.do_raise_window ); + cSetLocalPref( "regex_pattern", inPrefs->chat.regex_pattern ); iSetLocalPref( "do_smiley", inPrefs->chat.do_smiley ); iSetLocalPref( "do_send_idle_time", inPrefs->chat.do_send_idle_time ); iSetLocalPref( "do_ignore_fore", inPrefs->chat.do_ignore_fore ); Index: prefs.h =================================================================== RCS file: /cvsroot/ayttm/ayttm/src/prefs.h,v retrieving revision 1.21 retrieving revision 1.22 diff -u -r1.21 -r1.22 --- prefs.h 26 Aug 2009 09:26:14 -0000 1.21 +++ prefs.h 30 Aug 2009 13:58:59 -0000 1.22 @@ -66,6 +66,7 @@ { int do_ignore_unknown; int do_raise_window; + char regex_pattern[MAX_PREF_LEN]; int do_send_idle_time; int do_convo_timestamp; int do_smiley; |
From: Piotr S. <ps...@us...> - 2009-08-30 13:59:13
|
Update of /cvsroot/ayttm/ayttm/src/gtk In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv21533/gtk Modified Files: prefs_window.C Log Message: Only raise window on particular regex. This closes #856326 Index: prefs_window.C =================================================================== RCS file: /cvsroot/ayttm/ayttm/src/gtk/prefs_window.C,v retrieving revision 1.54 retrieving revision 1.55 diff -u -r1.54 -r1.55 --- prefs_window.C 26 Aug 2009 09:26:14 -0000 1.54 +++ prefs_window.C 30 Aug 2009 13:58:59 -0000 1.55 @@ -212,6 +212,7 @@ struct prefs::chat &m_prefs; GtkWidget *m_dictionary_entry; + GtkWidget *m_regex_entry; GtkWidget *m_font_face_entry; GtkWidget *m_font_sel_win; int m_font_sel_conn_id; @@ -1196,6 +1197,7 @@ : ay_prefs_window_panel( inTopFrameText ), m_prefs( inPrefs ), m_dictionary_entry( NULL ), + m_regex_entry( NULL ), m_font_face_entry( NULL ), m_font_sel_win( NULL ), m_font_sel_conn_id( 0 ) @@ -1205,19 +1207,45 @@ // Build void ay_chat_panel::Build( GtkWidget *inParent ) { - _gtkut_button( _("Send idle/away status to servers"), &m_prefs.do_send_idle_time, m_top_vbox ); - _gtkut_button( _("Show timestamps in chat window"), &m_prefs.do_convo_timestamp, m_top_vbox ); - _gtkut_button( _("Raise chat-window when receiving a message"), &m_prefs.do_raise_window, m_top_vbox ); - _gtkut_button( _("Enable Smileys"), &m_prefs.do_smiley, m_top_vbox ); - _gtkut_button( _("Ignore unknown people"), &m_prefs.do_ignore_unknown, m_top_vbox ); - _gtkut_button( _("On the fly chat completion"), &m_prefs.do_auto_complete, m_top_vbox ); - - GtkWidget *hbox = NULL; GtkWidget *spacer = NULL; GtkWidget *label = NULL; GtkWidget *button = NULL; + + _gtkut_button( _("Send idle/away status to servers"), &m_prefs.do_send_idle_time, m_top_vbox ); + _gtkut_button( _("Show timestamps in chat window"), &m_prefs.do_convo_timestamp, m_top_vbox ); + + // raise button + hbox = gtk_hbox_new( FALSE, 0 ); + gtk_widget_show( hbox ); + button = _gtkut_button( _("Raise chat-window when receiving a message"), &m_prefs.do_raise_window, hbox ); + gtk_signal_connect( GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(s_toggle_checkbox), this ); + gtk_box_pack_start( GTK_BOX(m_top_vbox), hbox, FALSE, FALSE, 0 ); + + // regex dialog + hbox = gtk_hbox_new( FALSE, 0 ); + gtk_widget_show( hbox ); + spacer = gtk_label_new( "" ); + gtk_widget_show( spacer ); + gtk_widget_set_usize( spacer, 15, -1 ); + gtk_box_pack_start( GTK_BOX(hbox), spacer, FALSE, FALSE, 0 ); + + label = gtk_label_new( _("Only on regex:") ); + gtk_widget_show( label ); + gtk_box_pack_start( GTK_BOX(hbox), label, FALSE, FALSE, 0 ); + + m_regex_entry = gtk_entry_new(); + gtk_widget_show( m_regex_entry ); + gtk_entry_set_text( GTK_ENTRY(m_regex_entry), m_prefs.regex_pattern ); + gtk_box_pack_start( GTK_BOX(hbox), m_regex_entry, TRUE, TRUE, 10 ); + + gtk_box_pack_start( GTK_BOX(m_top_vbox), hbox, FALSE, FALSE, 0 ); + + + _gtkut_button( _("Ignore unknown people"), &m_prefs.do_ignore_unknown, m_top_vbox ); + _gtkut_button( _("On the fly chat completion"), &m_prefs.do_auto_complete, m_top_vbox ); + #ifdef HAVE_LIBASPELL hbox = gtk_hbox_new( FALSE, 0 ); gtk_widget_show( hbox ); @@ -1325,7 +1353,8 @@ } strncpy( m_prefs.spell_dictionary, gtk_entry_get_text(GTK_ENTRY(m_dictionary_entry)), MAX_PREF_LEN ); - + strncpy( m_prefs.regex_pattern, gtk_entry_get_text(GTK_ENTRY(m_regex_entry)), MAX_PREF_LEN ); + if ( needs_reload ) ay_spell_check_reload(); #endif @@ -1334,6 +1363,7 @@ // SetActiveWidgets void ay_chat_panel::SetActiveWidgets( void ) { + gtk_widget_set_sensitive( m_regex_entry, m_prefs.do_raise_window ); #ifdef HAVE_LIBASPELL gtk_widget_set_sensitive( m_dictionary_entry, m_prefs.do_spell_checking ); #endif |
From: Piotr S. <ps...@us...> - 2009-08-30 13:55:51
|
Update of /cvsroot/ayttm/ayttm/modules/jabber In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv21348 Modified Files: jabber.c libEBjabber.c libEBjabber.h Log Message: Gmail Notifications support Index: jabber.c =================================================================== RCS file: /cvsroot/ayttm/ayttm/modules/jabber/jabber.c,v retrieving revision 1.56 retrieving revision 1.57 diff -u -r1.56 -r1.57 --- jabber.c 28 Aug 2009 11:30:33 -0000 1.56 +++ jabber.c 30 Aug 2009 13:55:35 -0000 1.57 @@ -158,29 +158,6 @@ char *profile; } jabber_info_data; - -/* Use this struct to hold any service specific information you need about - * local accounts - * below are just some suggested values - */ - -typedef struct _eb_jabber_local_account_data -{ - char password[MAX_PREF_LEN]; // account password - int fd; // the file descriptor - int status; // the current status of the user - int prompt_password; - JABBER_Conn *JConn; - int activity_tag; - int connect_tag; - int typing_tag; - int use_ssl; - char server_port[MAX_PREF_LEN]; - char ssl_server_port[MAX_PREF_LEN]; - char connect_server[MAX_PREF_LEN]; - LList *jabber_contacts; -} eb_jabber_local_account_data; - static void eb_jabber_terminate_chat( eb_account * account ); static void eb_jabber_add_user( eb_account * account ); static void eb_jabber_del_user( eb_account * account ); @@ -317,8 +294,8 @@ #endif port = atoi(jlad->server_port); - jlad->connect_tag = JABBER_Login(account->handle, (char *)password, - jabber_server, jlad->connect_server, jlad->use_ssl, port); + jlad->connect_tag = JABBER_Login( + account->handle, (char *)password, jabber_server, jlad, port); } static void eb_jabber_login( eb_local_account * account ) @@ -491,7 +468,7 @@ il->name = "USE_SSL"; il->label= _("Use _SSL"); il->type = EB_INPUT_CHECKBOX; -#endif +#endif il->next = g_new0(input_list, 1); il = il->next; il->widget.entry.value = jlad->server_port; @@ -506,7 +483,14 @@ il->name = "SSL_PORT"; il->label= _("SSL Po_rt:"); il->type = EB_INPUT_ENTRY; -#endif +#endif + + il->next = g_new0(input_list, 1); + il = il->next; + il->widget.checkbox.value = &jlad->request_gmail; + il->name = "gmail_request"; + il->label= _("Request mail information (GMail only)"); + il->type = EB_INPUT_CHECKBOX; } static eb_local_account * eb_jabber_read_local_account_config( LList * values ) Index: libEBjabber.c =================================================================== RCS file: /cvsroot/ayttm/ayttm/modules/jabber/libEBjabber.c,v retrieving revision 1.29 retrieving revision 1.30 diff -u -r1.29 -r1.30 --- libEBjabber.c 21 Aug 2009 07:35:59 -0000 1.29 +++ libEBjabber.c 30 Aug 2009 13:55:35 -0000 1.30 @@ -262,7 +262,7 @@ /* Functions called from the ayttm jabber.c file */ -int JABBER_Login(char *handle, char *passwd, char *host, char *connect_server, int use_ssl, int port) { +int JABBER_Login(char *handle, char *passwd, char *host, eb_jabber_local_account_data *jlad, int port) { /* At this point, we don't care about host and port */ char jid[256+1]; int tag; @@ -271,9 +271,9 @@ JABBER_Conn *JConn=NULL; /* If a different connect server is not specified then atleast connect to the default */ - if( !strcmp(connect_server, "") ) { - eb_debug(DBG_JBR, "connect_server is BLANK!\n\n"); - strcpy(connect_server, host); + if( !strcmp(jlad->connect_server, "") ) { + eb_debug(DBG_JBR, "jlad->connect_server is BLANK!\n\n"); + strcpy(jlad->connect_server, host); } eb_debug(DBG_JBR, "%s %s %i\n", handle, host, port); @@ -307,7 +307,7 @@ strncpy(JConn->jid,jid, LINE_LENGTH); /* We assume we have an account, and don't need to register one */ JConn->reg_flag = 0; - JConn->conn=jab_new(jid, passwd, connect_server); + JConn->conn=jab_new(jid, passwd, jlad->connect_server); if(!JConn->conn) { snprintf(buff, 4096, "Connection to server '%s' failed.", host); JABBERError(buff, _("Jabber Error")); @@ -328,7 +328,8 @@ jab_state_handler(JConn->conn, j_on_state_handler); JConn->conn->user->port = port; - JConn->conn->usessl = use_ssl; + JConn->conn->usessl = jlad->use_ssl; + JConn->do_request_gmail = jlad->request_gmail; tag = jab_start(JConn->conn); @@ -377,6 +378,8 @@ eb_debug(DBG_JBR, "******Called with NULL JConn for user %s!!!\n", handle); return(0); } + if (!strcmp(handle, "mailbox@gmail")) + return 0; eb_debug(DBG_JBR, "%s -> %s:\nOUT.msg: %s\n", JConn->jid, handle, message); /* We always want to chat. :) */ x = jutil_msgnew(TMSG_CHAT, handle, NULL, message); @@ -592,6 +595,77 @@ return(0); } +static char nt_time[13] = "0"; + +void request_new_gmail(JABBER_Conn *JConn, char *id) +{ + gchar *request, *stime; + + if (!JConn->do_request_gmail) + return; + + stime = (strcmp(nt_time, "0")) + ? g_strdup_printf(" newer-than-time='%s'", nt_time) + : g_strdup(""); + + request = g_strdup_printf( + "<iq type='get' " + "from='%s' " + "to='%s@%s' " + "id='mail-request-%s'>" + "<query xmlns='google:mail:notify'" + "%s" + "/></iq>", + JConn->jid, + JConn->conn->user->user, + JConn->conn->user->server, + id, + stime + ); + jab_send_raw(JConn->conn, request); + g_free(request); + g_free(stime); +} + +void print_new_gmail(JABBER_Conn *JConn, xmlnode x) +{ + xmlnode y, z; + char *subject, *snippet; + JABBER_InstantMessage JIM; + struct jabber_buddy JB; + char *total_matched, *result_time; + int new_mail; + + result_time = xmlnode_get_attrib(x, "result-time"); + total_matched = xmlnode_get_attrib(x, "total-matched"); + new_mail = strcmp(total_matched, "0"); + JB.description = total_matched; + JB.jid = "mailbox@gmail"; + JB.status = new_mail ? JABBER_ONLINE : JABBER_AWAY; + JB.JConn = JConn; + JABBERStatusChange(&JB); + + if (!new_mail) + return; + + for (y = xmlnode_get_tag(x, "mail-thread-info"); y; y = xmlnode_get_nextsibling(y)) { + if (strcmp(nt_time, xmlnode_get_attrib(y, "date")) > 0) + /* if nt_time > date of email, then I don't want to know about it */ + continue; + z = xmlnode_get_tag(y, "subject"); + subject = xmlnode_get_data(z); + z = xmlnode_get_tag(y, "snippet"); + snippet = xmlnode_get_data(z); + JIM.msg = g_strconcat(_("You have new email: \n"), subject, "\n", snippet, NULL); + JIM.JConn = JConn; + JIM.sender = "mailbox@gmail"; + JABBERInstantMessage(&JIM); + g_free(JIM.msg); + } + eb_debug(DBG_JBR, "old %s, new %s\n", nt_time, result_time); + strncpy(nt_time, result_time, 13); +} + void JABBER_Send_typing(JABBER_Conn *JConn, const char *from, const char *to, int typing) { /* @@ -863,8 +937,8 @@ return; } if (!strcmp(type, "result")) { - if (!(x = xmlnode_get_tag(packet->x, "query"))) { - /* If there is no <query/>, <id> is the only way to recognize IQ */ + if (!(x = xmlnode_get_firstchild(packet->x))) { + /* If there is no child, <id> is the only way to recognize IQ */ if (!strcmp(id, "id_auth")) { eb_debug(DBG_JBR, "Authorization successful, announcing presence\n"); jab_send_raw(conn, "<presence/>"); @@ -919,14 +993,34 @@ for (y = xmlnode_get_tag(x, "feature"); y; y = xmlnode_get_nextsibling(y)) { name = xmlnode_get_attrib(y, "var"); eb_debug(DBG_JBR, "Feature: %s\n", name); + if (!strcmp(name, "google:mail:notify")) + JConn->server_features |= F_GMAIL_NOTIFY; + /* More to come? */ + } + if ((JConn->server_features & F_GMAIL_NOTIFY) && JConn->do_request_gmail) { + JB.jid = strdup("mailbox@gmail"); + JB.name = strdup("GMailbox"); + JB.sub = strdup("both"); + JB.status = JABBER_AWAY; + JB.JConn = JConn; + JABBERAddBuddy(&JB); + free(JB.name); + free(JB.sub); + free(JB.jid); + request_new_gmail(JConn, "0"); } } + else if (!strcmp(ns, "google:mail:notify")) + if ((x = xmlnode_get_tag(packet->x, "mailbox"))) + print_new_gmail(JConn, x); + eb_debug(DBG_JBR, "<\n"); return; } - else - if (!strcmp(type, "set")) { - x = xmlnode_get_tag(packet->x, "query"); + else if (!strcmp(type, "set")) { + if (!(x = xmlnode_get_firstchild(packet->x))) + return; + ns = xmlnode_get_attrib(x, "xmlns"); if (!strcmp(ns, NS_ROSTER)) { y = xmlnode_get_tag(x, "item"); @@ -938,16 +1032,35 @@ if (sub && !strcmp(sub, "remove")) eb_debug(DBG_JBR, "Need to remove a buddy: %s\n", alias); } + else if (!strcmp(ns, "google:mail:notify")) { + gchar *success; + + success = g_strdup_printf( + "<iq type='result' " + "from='%s' " + "to='%s@%s' " + "id='%s' />", + JConn->jid, + JConn->conn->user->user, + JConn->conn->user->server, + id + ); + jab_send_raw(JConn->conn, success); + g_free(success); + request_new_gmail(JConn, id); + } } - else - if (!strcmp(type, "error")) { + else if (!strcmp(type, "error")) { x = xmlnode_get_tag(packet->x, "error"); from = xmlnode_get_attrib(packet->x, "from"); to=xmlnode_get_attrib(packet->x, "to"); code = xmlnode_get_attrib(x, "code"); name = xmlnode_get_attrib(x, "id"); desc = xmlnode_get_tag_data(packet->x, "error"); - eb_debug(DBG_JBR, "Received error: [%i]%s from %s[%s], sent to %s\n", atoi(code), desc, from, name, to); + eb_debug( + DBG_JBR, "Received error: [%i]%s from %s[%s], sent to %s\n", + atoi(code), desc, from, name, to); + switch (atoi(code)) { case 401: /* Unauthorized */ if (JConn->reg_flag) Index: libEBjabber.h =================================================================== RCS file: /cvsroot/ayttm/ayttm/modules/jabber/libEBjabber.h,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- libEBjabber.h 15 Aug 2009 19:57:27 -0000 1.10 +++ libEBjabber.h 30 Aug 2009 13:55:35 -0000 1.11 @@ -7,10 +7,11 @@ #define DEFAULT_HOST "jabber.com" #define DEFAULT_PORT 5222 - #define LINE_LENGTH 513 - #define DBG_JBR do_jabber_debug + +#define F_GMAIL_NOTIFY (1 << 0) + extern int do_jabber_debug; extern GList *agent_list; @@ -50,20 +51,40 @@ struct JABBERCONN *next; AyConnection *connection; int state; + int server_features; + int do_request_gmail; } JABBER_Conn; typedef struct INSTANT_MESSAGE { - int year; /* six fields used for time stamping */ - int month; - int day; - int hour; - int minute; - int sec; char *msg; /* message itself */ char *sender; /* sender of the message */ JABBER_Conn *JConn; } JABBER_InstantMessage, *JABBER_InstantMessage_PTR; + +/* Use this struct to hold any service specific information you need about + * local accounts + * below are just some suggested values + */ + +typedef struct _eb_jabber_local_account_data +{ + char password[MAX_PREF_LEN]; // account password + int fd; // the file descriptor + int status; // the current status of the user + int prompt_password; + JABBER_Conn *JConn; + int activity_tag; + int connect_tag; + int typing_tag; + int use_ssl; + int request_gmail; + char server_port[MAX_PREF_LEN]; + char ssl_server_port[MAX_PREF_LEN]; + char connect_server[MAX_PREF_LEN]; + LList *jabber_contacts; +} eb_jabber_local_account_data; + struct jabber_buddy { char *name; /* Users name */ @@ -119,7 +140,7 @@ ** Output: 0 on success, -1 on failure */ -int JABBER_Login(char *handle, char *passwd, char *host, char *connect_server, int use_ssl, int port); +int JABBER_Login(char *handle, char *passwd, char *host, eb_jabber_local_account_data *jlad, int port); /* ** Name: JABBER_SendMessage ** Purpose: This function encapuslates the sending of an instant message |
From: Siddhesh P. <sid...@us...> - 2009-08-29 19:26:53
|
Update of /cvsroot/ayttm/ayttm In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv26523 Modified Files: ChangeLog configure.ac Log Message: * YMSG: Fixed memory leak * YMSG: Fixed conferencing to work with YMSG16 * YMSG: Prettier messages * CORE: Fixed case where preferred account for a room would be reset when a chat room is cloned out of it Index: ChangeLog =================================================================== RCS file: /cvsroot/ayttm/ayttm/ChangeLog,v retrieving revision 1.810 retrieving revision 1.811 diff -u -r1.810 -r1.811 --- ChangeLog 28 Aug 2009 11:36:24 -0000 1.810 +++ ChangeLog 29 Aug 2009 19:26:40 -0000 1.811 @@ -1,3 +1,13 @@ +* Sat Aug 29 2009 19:25 UTC [siddheshp] 0.5.0-136 +- ChangeLog, configure.ac, modules/yahoo2/yahoo.c, +modules/yahoo2/libyahoo2/libyahoo2.c, src/chat_room.c: + * YMSG: Fixed memory leak + * YMSG: Fixed conferencing to work with YMSG16 + * YMSG: Prettier messages + * CORE: Fixed case where preferred account for a room would be reset when a + chat room is cloned out of it + + * Fri Aug 28 2009 11:30 UTC [pstef] 0.5.0-135 - ChangeLog, configure.ac, src/account.h, src/contact.h, src/service.h, src/status.c, src/util.c, modules/jabber/jabber.c, modules/yahoo2/yahoo.c: Index: configure.ac =================================================================== RCS file: /cvsroot/ayttm/ayttm/configure.ac,v retrieving revision 1.627 retrieving revision 1.628 diff -u -r1.627 -r1.628 --- configure.ac 28 Aug 2009 11:36:24 -0000 1.627 +++ configure.ac 29 Aug 2009 19:26:40 -0000 1.628 @@ -5,7 +5,7 @@ AC_PREREQ(2.53) AC_CONFIG_SRCDIR(src/main.c) AM_INIT_AUTOMAKE([1.6 dist-bzip2 dist-zip]) -RELEASE=135 +RELEASE=136 # This is to check modules/core binary compat # Bump it up when necessary only (query_callbacks change, struct change etc) |
From: Siddhesh P. <sid...@us...> - 2009-08-29 19:26:53
|
Update of /cvsroot/ayttm/ayttm/modules/yahoo2/libyahoo2 In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv26523/modules/yahoo2/libyahoo2 Modified Files: libyahoo2.c Log Message: * YMSG: Fixed memory leak * YMSG: Fixed conferencing to work with YMSG16 * YMSG: Prettier messages * CORE: Fixed case where preferred account for a room would be reset when a chat room is cloned out of it Index: libyahoo2.c =================================================================== RCS file: /cvsroot/ayttm/ayttm/modules/yahoo2/libyahoo2/libyahoo2.c,v retrieving revision 1.54 retrieving revision 1.55 diff -u -r1.54 -r1.55 --- libyahoo2.c 26 Aug 2009 16:25:56 -0000 1.54 +++ libyahoo2.c 29 Aug 2009 19:26:40 -0000 1.55 @@ -1026,9 +1026,7 @@ YAHOO_CALLBACK(ext_yahoo_error)(yd->client_id, msg, 0, E_CONFNOTAVAIL); break; case YAHOO_SERVICE_CONFADDINVITE: - if(pkt->status == 2) - ; - else + if(pkt->status == 1) YAHOO_CALLBACK(ext_yahoo_got_conf_invite)(yd->client_id, id, host, room, msg, members); break; case YAHOO_SERVICE_CONFDECLINE: @@ -4045,10 +4043,10 @@ pkt = yahoo_packet_new(YAHOO_SERVICE_CONFLOGON, YPACKET_STATUS_DEFAULT, yd->session_id); yahoo_packet_hash(pkt, 1, (from?from:yd->user)); - for(; who; who = who->next) { - yahoo_packet_hash(pkt, 3, (char *)who->data); - } + yahoo_packet_hash(pkt, 3, (from?from:yd->user)); yahoo_packet_hash(pkt, 57, room); + for(; who; who = who->next) + yahoo_packet_hash(pkt, 3, (char *)who->data); yahoo_send_packet(yid, pkt, 0); @@ -4068,9 +4066,9 @@ pkt = yahoo_packet_new(YAHOO_SERVICE_CONFDECLINE, YPACKET_STATUS_DEFAULT, yd->session_id); yahoo_packet_hash(pkt, 1, (from?from:yd->user)); - for(; who; who = who->next) { + yahoo_packet_hash(pkt, 3, (from?from:yd->user)); + for(; who; who = who->next) yahoo_packet_hash(pkt, 3, (char *)who->data); - } yahoo_packet_hash(pkt, 57, room); yahoo_packet_hash(pkt, 14, msg); @@ -4092,9 +4090,10 @@ pkt = yahoo_packet_new(YAHOO_SERVICE_CONFLOGOFF, YPACKET_STATUS_DEFAULT, yd->session_id); yahoo_packet_hash(pkt, 1, (from?from:yd->user)); - for(; who; who = who->next) { + yahoo_packet_hash(pkt, 3, (from?from:yd->user)); + for(; who; who = who->next) yahoo_packet_hash(pkt, 3, (char *)who->data); - } + yahoo_packet_hash(pkt, 57, room); yahoo_send_packet(yid, pkt, 0); @@ -4115,9 +4114,10 @@ pkt = yahoo_packet_new(YAHOO_SERVICE_CONFMSG, YPACKET_STATUS_DEFAULT, yd->session_id); yahoo_packet_hash(pkt, 1, (from?from:yd->user)); - for(; who; who = who->next) { + yahoo_packet_hash(pkt, 53, (from?from:yd->user)); + for(; who; who = who->next) yahoo_packet_hash(pkt, 53, (char *)who->data); - } + yahoo_packet_hash(pkt, 57, room); yahoo_packet_hash(pkt, 14, msg); |