From 764c7d1009feda7db971ea7ac6bcb2a4acef0efc Mon Sep 17 00:00:00 2001 From: Sven Moritz Hallberg Date: Sun, 3 Feb 2008 22:30:03 +0100 Subject: OTR support, first checkin --- protocols/nogaim.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'protocols') diff --git a/protocols/nogaim.c b/protocols/nogaim.c index 3ce15166..d8bfad14 100644 --- a/protocols/nogaim.c +++ b/protocols/nogaim.c @@ -629,9 +629,15 @@ void imcb_buddy_msg( struct im_connection *ic, char *handle, char *msg, uint32_t irc_t *irc = ic->irc; char *wrapped; user_t *u; - + + /* pass the message through OTR */ + msg = otr_handle_message(ic, handle, msg); + if(!msg) { + /* this was an internal OTR protocol message */ + return; + } + u = user_findhandle( ic, handle ); - if( !u ) { char *h = set_getstr( &irc->set, "handle_unknown" ); @@ -641,6 +647,7 @@ void imcb_buddy_msg( struct im_connection *ic, char *handle, char *msg, uint32_t if( set_getbool( &irc->set, "debug" ) ) imcb_log( ic, "Ignoring message from unknown handle %s", handle ); + g_free(msg); return; } else if( g_strncasecmp( h, "add", 3 ) == 0 ) @@ -673,6 +680,7 @@ void imcb_buddy_msg( struct im_connection *ic, char *handle, char *msg, uint32_t wrapped = word_wrap( msg, 425 ); irc_msgfrom( irc, u->nick, wrapped ); g_free( wrapped ); + g_free( msg ); } void imcb_buddy_typing( struct im_connection *ic, char *handle, uint32_t flags ) @@ -990,10 +998,11 @@ int imc_buddy_msg( struct im_connection *ic, char *handle, char *msg, int flags buf = escape_html( msg ); msg = buf; } + + /* if compiled without otr support, this just calls the prpl buddy_msg */ + st = otr_send_message(ic, handle, msg, flags); - st = ic->acc->prpl->buddy_msg( ic, handle, msg, flags ); - g_free( buf ); - + g_free(buf); return st; } -- cgit v1.2.3 From 5a71d9c5b14aa749b532666b71b25ce2afcdc5bb Mon Sep 17 00:00:00 2001 From: Sven Moritz Hallberg Date: Sat, 9 Feb 2008 18:58:13 +0100 Subject: - add support for setting ops/voice according to OTR msgstate - add 'otr trust' user command - support non-otr messages during keygen - run otr messages through strip_html - interpret and tags in html messages - record max message size in prpl - add 'encrypted' flag to user_t - cosmetics --- protocols/jabber/jabber.c | 1 + protocols/msn/msn.c | 1 + protocols/nogaim.c | 17 +++++++++++------ protocols/nogaim.h | 4 ++++ protocols/oscar/oscar.c | 1 + protocols/yahoo/yahoo.c | 1 + 6 files changed, 19 insertions(+), 6 deletions(-) (limited to 'protocols') diff --git a/protocols/jabber/jabber.c b/protocols/jabber/jabber.c index 243ed7fd..dac18bae 100644 --- a/protocols/jabber/jabber.c +++ b/protocols/jabber/jabber.c @@ -510,6 +510,7 @@ void jabber_initmodule() struct prpl *ret = g_new0( struct prpl, 1 ); ret->name = "jabber"; + ret->mms = 0; /* no limit */ ret->login = jabber_login; ret->init = jabber_init; ret->logout = jabber_logout; diff --git a/protocols/msn/msn.c b/protocols/msn/msn.c index a2e8519a..335ae894 100644 --- a/protocols/msn/msn.c +++ b/protocols/msn/msn.c @@ -371,6 +371,7 @@ void msn_initmodule() struct prpl *ret = g_new0(struct prpl, 1); ret->name = "msn"; + ret->mms = 1409; /* this guess taken from libotr UPGRADING file */ ret->login = msn_login; ret->init = msn_init; ret->logout = msn_logout; diff --git a/protocols/nogaim.c b/protocols/nogaim.c index d8bfad14..138e2ce1 100644 --- a/protocols/nogaim.c +++ b/protocols/nogaim.c @@ -602,10 +602,9 @@ void imcb_buddy_status( struct im_connection *ic, const char *handle, int flags, /* else waste_any_state_information_for_now(); */ /* LISPy... */ - if( ( set_getbool( &ic->irc->set, "away_devoice" ) ) && /* Don't do a thing when user doesn't want it */ - ( u->online ) && /* Don't touch offline people */ - ( ( ( u->online != oo ) && !u->away ) || /* Voice joining people */ - ( ( u->online == oo ) && ( oa == !u->away ) ) ) ) /* (De)voice people changing state */ + if( ( u->online ) && /* Don't touch offline people */ + ( ( ( u->online != oo ) && !u->away ) || /* Do joining people */ + ( ( u->online == oo ) && ( oa == !u->away ) ) ) ) /* Do people changing state */ { char *from; @@ -618,8 +617,14 @@ void imcb_buddy_status( struct im_connection *ic, const char *handle, int flags, from = g_strdup_printf( "%s!%s@%s", ic->irc->mynick, ic->irc->mynick, ic->irc->myhost ); } - irc_write( ic->irc, ":%s MODE %s %cv %s", from, ic->irc->channel, - u->away?'-':'+', u->nick ); + if(!strcmp(set_getstr(&ic->irc->set, "voice_buddies"), "notaway")) { + irc_write( ic->irc, ":%s MODE %s %cv %s", from, ic->irc->channel, + u->away?'-':'+', u->nick ); + } + if(!strcmp(set_getstr(&ic->irc->set, "op_buddies"), "notaway")) { + irc_write( ic->irc, ":%s MODE %s %co %s", from, ic->irc->channel, + u->away?'-':'+', u->nick ); + } g_free( from ); } } diff --git a/protocols/nogaim.h b/protocols/nogaim.h index 7d391edd..3eb640e2 100644 --- a/protocols/nogaim.h +++ b/protocols/nogaim.h @@ -135,6 +135,10 @@ struct prpl { /* You should set this to the name of your protocol. * - The user sees this name ie. when imcb_log() is used. */ const char *name; + /* Maximum Message Size of this protocol. + * - Introduced for OTR, in order to fragment large protocol messages. + * - 0 means "unlimited". */ + unsigned int mms; /* Added this one to be able to add per-account settings, don't think * it should be used for anything else. You are supposed to use the diff --git a/protocols/oscar/oscar.c b/protocols/oscar/oscar.c index 30ad4b68..9167f6a3 100644 --- a/protocols/oscar/oscar.c +++ b/protocols/oscar/oscar.c @@ -2602,6 +2602,7 @@ void oscar_initmodule() { struct prpl *ret = g_new0(struct prpl, 1); ret->name = "oscar"; + ret->mms = 2343; /* this guess taken from libotr UPGRADING file */ ret->away_states = oscar_away_states; ret->init = oscar_init; ret->login = oscar_login; diff --git a/protocols/yahoo/yahoo.c b/protocols/yahoo/yahoo.c index 9f9ffcf7..52747bb4 100644 --- a/protocols/yahoo/yahoo.c +++ b/protocols/yahoo/yahoo.c @@ -353,6 +353,7 @@ void byahoo_initmodule( ) { struct prpl *ret = g_new0(struct prpl, 1); ret->name = "yahoo"; + ret->mms = 832; /* this guess taken from libotr UPGRADING file */ ret->init = byahoo_init; ret->login = byahoo_login; -- cgit v1.2.3 From f55cfe93aeae5c24fd067e28733826d7e3029085 Mon Sep 17 00:00:00 2001 From: Sven Moritz Hallberg Date: Sat, 9 Feb 2008 23:24:39 +0100 Subject: remove old away_devoice stuff --- protocols/nogaim.c | 64 ------------------------------------------------------ protocols/nogaim.h | 1 - 2 files changed, 65 deletions(-) (limited to 'protocols') diff --git a/protocols/nogaim.c b/protocols/nogaim.c index 138e2ce1..542a4269 100644 --- a/protocols/nogaim.c +++ b/protocols/nogaim.c @@ -926,70 +926,6 @@ static int remove_chat_buddy_silent( struct groupchat *b, const char *handle ) } -/* Misc. BitlBee stuff which shouldn't really be here */ - -char *set_eval_away_devoice( set_t *set, char *value ) -{ - irc_t *irc = set->data; - int st; - - if( ( g_strcasecmp( value, "true" ) == 0 ) || ( g_strcasecmp( value, "yes" ) == 0 ) || ( g_strcasecmp( value, "on" ) == 0 ) ) - st = 1; - else if( ( g_strcasecmp( value, "false" ) == 0 ) || ( g_strcasecmp( value, "no" ) == 0 ) || ( g_strcasecmp( value, "off" ) == 0 ) ) - st = 0; - else if( sscanf( value, "%d", &st ) != 1 ) - return( NULL ); - - st = st != 0; - - /* Horror.... */ - - if( st != set_getbool( &irc->set, "away_devoice" ) ) - { - char list[80] = ""; - user_t *u = irc->users; - int i = 0, count = 0; - char pm; - char v[80]; - - if( st ) - pm = '+'; - else - pm = '-'; - - while( u ) - { - if( u->ic && u->online && !u->away ) - { - if( ( strlen( list ) + strlen( u->nick ) ) >= 79 ) - { - for( i = 0; i < count; v[i++] = 'v' ); v[i] = 0; - irc_write( irc, ":%s MODE %s %c%s%s", - irc->myhost, - irc->channel, pm, v, list ); - - *list = 0; - count = 0; - } - - sprintf( list + strlen( list ), " %s", u->nick ); - count ++; - } - u = u->next; - } - - /* $v = 'v' x $i */ - for( i = 0; i < count; v[i++] = 'v' ); v[i] = 0; - irc_write( irc, ":%s MODE %s %c%s%s", irc->myhost, - irc->channel, pm, v, list ); - } - - return( set_eval_bool( set, value ) ); -} - - - - /* The plan is to not allow straight calls to prpl functions anymore, but do them all from some wrappers. We'll start to define some down here: */ diff --git a/protocols/nogaim.h b/protocols/nogaim.h index 3eb640e2..3caefe2b 100644 --- a/protocols/nogaim.h +++ b/protocols/nogaim.h @@ -320,7 +320,6 @@ void imc_add_block( struct im_connection *ic, char *handle ); void imc_rem_block( struct im_connection *ic, char *handle ); /* Misc. stuff */ -char *set_eval_away_devoice( set_t *set, char *value ); gboolean auto_reconnect( gpointer data, gint fd, b_input_condition cond ); void cancel_auto_reconnect( struct account *a ); -- cgit v1.2.3 From 52e6e17d3b3610afd6d6b997257b72e798d95c47 Mon Sep 17 00:00:00 2001 From: Sven Moritz Hallberg Date: Sun, 10 Feb 2008 14:36:43 +0100 Subject: Support halfops for 'notaway' status etc. --- protocols/nogaim.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'protocols') diff --git a/protocols/nogaim.c b/protocols/nogaim.c index 542a4269..c2966323 100644 --- a/protocols/nogaim.c +++ b/protocols/nogaim.c @@ -621,6 +621,10 @@ void imcb_buddy_status( struct im_connection *ic, const char *handle, int flags, irc_write( ic->irc, ":%s MODE %s %cv %s", from, ic->irc->channel, u->away?'-':'+', u->nick ); } + if(!strcmp(set_getstr(&ic->irc->set, "halfop_buddies"), "notaway")) { + irc_write( ic->irc, ":%s MODE %s %ch %s", from, ic->irc->channel, + u->away?'-':'+', u->nick ); + } if(!strcmp(set_getstr(&ic->irc->set, "op_buddies"), "notaway")) { irc_write( ic->irc, ":%s MODE %s %co %s", from, ic->irc->channel, u->away?'-':'+', u->nick ); -- cgit v1.2.3 From 823de9d44f262ea2364ac8ec6a1e18e0f7dab658 Mon Sep 17 00:00:00 2001 From: Sven Moritz Hallberg Date: Thu, 12 Mar 2009 20:10:06 +0100 Subject: commit updates by ashish shukla --- protocols/jabber/jabber.c | 2 +- protocols/jabber/jabber_util.c | 4 +-- protocols/msn/msn.c | 61 ++--------------------------------------- protocols/msn/msn.h | 6 ++++ protocols/msn/ns.c | 23 ++-------------- protocols/msn/sb.c | 42 ++++++++++++++++++++++++++++ protocols/nogaim.c | 10 +++++-- protocols/yahoo/libyahoo2.c | 2 ++ protocols/yahoo/yahoo.c | 3 -- protocols/yahoo/yahoo_httplib.c | 2 ++ 10 files changed, 68 insertions(+), 87 deletions(-) (limited to 'protocols') diff --git a/protocols/jabber/jabber.c b/protocols/jabber/jabber.c index 5fb2c4fc..518c9506 100644 --- a/protocols/jabber/jabber.c +++ b/protocols/jabber/jabber.c @@ -69,7 +69,7 @@ static void jabber_init( account_t *acc ) s = set_add( &acc->set, "resource_select", "priority", NULL, acc ); s = set_add( &acc->set, "server", NULL, set_eval_account, acc ); - s->flags |= ACC_SET_NOSAVE | ACC_SET_OFFLINE_ONLY; + s->flags |= ACC_SET_NOSAVE | ACC_SET_OFFLINE_ONLY | SET_NULL_OK; s = set_add( &acc->set, "ssl", "false", set_eval_bool, acc ); s->flags |= ACC_SET_OFFLINE_ONLY; diff --git a/protocols/jabber/jabber_util.c b/protocols/jabber/jabber_util.c index 1bee5009..19a73b6a 100644 --- a/protocols/jabber/jabber_util.c +++ b/protocols/jabber/jabber_util.c @@ -36,10 +36,10 @@ char *set_eval_priority( set_t *set, char *value ) { /* Priority is a signed 8-bit integer, according to RFC 3921. */ if( i < -128 || i > 127 ) - return NULL; + return SET_INVALID; } else - return NULL; + return SET_INVALID; /* Only run this stuff if the account is online ATM, and if the setting seems to be acceptable. */ diff --git a/protocols/msn/msn.c b/protocols/msn/msn.c index 335ae894..05eae541 100644 --- a/protocols/msn/msn.c +++ b/protocols/msn/msn.c @@ -112,7 +112,6 @@ static void msn_logout( struct im_connection *ic ) static int msn_buddy_msg( struct im_connection *ic, char *who, char *message, int away ) { struct msn_switchboard *sb; - struct msn_data *md = ic->proto_data; if( ( sb = msn_sb_by_handle( ic, who ) ) ) { @@ -121,47 +120,13 @@ static int msn_buddy_msg( struct im_connection *ic, char *who, char *message, in else { struct msn_message *m; - char buf[1024]; /* Create a message. We have to arrange a usable switchboard, and send the message later. */ m = g_new0( struct msn_message, 1 ); m->who = g_strdup( who ); m->text = g_strdup( message ); - /* FIXME: *CHECK* the reliability of using spare sb's! */ - if( ( sb = msn_sb_spare( ic ) ) ) - { - debug( "Trying to use a spare switchboard to message %s", who ); - - sb->who = g_strdup( who ); - g_snprintf( buf, sizeof( buf ), "CAL %d %s\r\n", ++sb->trId, who ); - if( msn_sb_write( sb, buf, strlen( buf ) ) ) - { - /* He/She should join the switchboard soon, let's queue the message. */ - sb->msgq = g_slist_append( sb->msgq, m ); - return( 1 ); - } - } - - debug( "Creating a new switchboard to message %s", who ); - - /* If we reach this line, there was no spare switchboard, so let's make one. */ - g_snprintf( buf, sizeof( buf ), "XFR %d SB\r\n", ++md->trId ); - if( !msn_write( ic, buf, strlen( buf ) ) ) - { - g_free( m->who ); - g_free( m->text ); - g_free( m ); - - return( 0 ); - } - - /* And queue the message to md. We'll pick it up when the switchboard comes up. */ - md->msgq = g_slist_append( md->msgq, m ); - - /* FIXME: If the switchboard creation fails, the message will not be sent. */ - - return( 1 ); + return msn_sb_write_msg( ic, m ); } return( 0 ); @@ -251,8 +216,6 @@ static void msn_chat_leave( struct groupchat *c ) static struct groupchat *msn_chat_with( struct im_connection *ic, char *who ) { struct msn_switchboard *sb; - struct msn_data *md = ic->proto_data; - char buf[1024]; if( ( sb = msn_sb_by_handle( ic, who ) ) ) { @@ -263,31 +226,13 @@ static struct groupchat *msn_chat_with( struct im_connection *ic, char *who ) { struct msn_message *m; - if( ( sb = msn_sb_spare( ic ) ) ) - { - debug( "Trying to reuse an existing switchboard as a groupchat with %s", who ); - g_snprintf( buf, sizeof( buf ), "CAL %d %s\r\n", ++sb->trId, who ); - if( msn_sb_write( sb, buf, strlen( buf ) ) ) - return msn_sb_to_chat( sb ); - } - - /* If the stuff above failed for some reason: */ - debug( "Creating a new switchboard to groupchat with %s", who ); - - /* Request a new switchboard. */ - g_snprintf( buf, sizeof( buf ), "XFR %d SB\r\n", ++md->trId ); - if( !msn_write( ic, buf, strlen( buf ) ) ) - return( 0 ); - /* Create a magic message. This is quite hackish, but who cares? :-P */ m = g_new0( struct msn_message, 1 ); m->who = g_strdup( who ); m->text = g_strdup( GROUPCHAT_SWITCHBOARD_MESSAGE ); - /* Queue the magic message and cross your fingers. */ - md->msgq = g_slist_append( md->msgq, m ); - - /* FIXME: Can I try to return something here already? */ + msn_sb_write_msg( ic, m ); + return NULL; } diff --git a/protocols/msn/msn.h b/protocols/msn/msn.h index 63759303..7c849acf 100644 --- a/protocols/msn/msn.h +++ b/protocols/msn/msn.h @@ -23,6 +23,9 @@ Suite 330, Boston, MA 02111-1307 USA */ +#ifndef _MSN_H +#define _MSN_H + /* Some hackish magicstrings to make special-purpose messages/switchboards. */ #define TYPING_NOTIFICATION_MESSAGE "\r\r\rBEWARE, ME R TYPINK MESSAGE!!!!\r\r\r" @@ -175,3 +178,6 @@ int msn_sb_sendmessage( struct msn_switchboard *sb, char *text ); struct groupchat *msn_sb_to_chat( struct msn_switchboard *sb ); void msn_sb_destroy( struct msn_switchboard *sb ); gboolean msn_sb_connected( gpointer data, gint source, b_input_condition cond ); +int msn_sb_write_msg( struct im_connection *ic, struct msn_message *m ); + +#endif //_MSN_H diff --git a/protocols/msn/ns.c b/protocols/msn/ns.c index fe48f96d..ffaa90a7 100644 --- a/protocols/msn/ns.c +++ b/protocols/msn/ns.c @@ -277,25 +277,11 @@ static int msn_ns_command( gpointer data, char **cmd, int num_parts ) { if( num_parts == 5 ) { - int i, groupcount; - - groupcount = atoi( cmd[4] ); - if( groupcount > 0 ) - { - /* valgrind says this is leaking memory, I'm guessing - that this happens during server redirects. */ - if( md->grouplist ) - { - for( i = 0; i < md->groupcount; i ++ ) - g_free( md->grouplist[i] ); - g_free( md->grouplist ); - } - - md->groupcount = groupcount; + md->buddycount = atoi( cmd[3] ); + md->groupcount = atoi( cmd[4] ); + if( md->groupcount > 0 ) md->grouplist = g_new0( char *, md->groupcount ); - } - md->buddycount = atoi( cmd[3] ); if( !*cmd[3] || md->buddycount == 0 ) msn_logged_in( ic ); } @@ -678,9 +664,6 @@ static int msn_ns_message( gpointer data, char *msg, int msglen, char **cmd, int { imcb_log( ic, "INBOX contains %s new messages, plus %s messages in other folders.", inbox, folders ); } - - g_free( inbox ); - g_free( folders ); } else if( g_strncasecmp( ct, "text/x-msmsgsemailnotification", 30 ) == 0 ) { diff --git a/protocols/msn/sb.c b/protocols/msn/sb.c index 18c41ef5..e9526234 100644 --- a/protocols/msn/sb.c +++ b/protocols/msn/sb.c @@ -47,6 +47,48 @@ int msn_sb_write( struct msn_switchboard *sb, char *s, int len ) return( 1 ); } +int msn_sb_write_msg( struct im_connection *ic, struct msn_message *m ) +{ + struct msn_data *md = ic->proto_data; + struct msn_switchboard *sb; + char buf[1024]; + + /* FIXME: *CHECK* the reliability of using spare sb's! */ + if( ( sb = msn_sb_spare( ic ) ) ) + { + debug( "Trying to use a spare switchboard to message %s", m->who ); + + sb->who = g_strdup( m->who ); + g_snprintf( buf, sizeof( buf ), "CAL %d %s\r\n", ++sb->trId, m->who ); + if( msn_sb_write( sb, buf, strlen( buf ) ) ) + { + /* He/She should join the switchboard soon, let's queue the message. */ + sb->msgq = g_slist_append( sb->msgq, m ); + return( 1 ); + } + } + + debug( "Creating a new switchboard to message %s", m->who ); + + /* If we reach this line, there was no spare switchboard, so let's make one. */ + g_snprintf( buf, sizeof( buf ), "XFR %d SB\r\n", ++md->trId ); + if( !msn_write( ic, buf, strlen( buf ) ) ) + { + g_free( m->who ); + g_free( m->text ); + g_free( m ); + + return( 0 ); + } + + /* And queue the message to md. We'll pick it up when the switchboard comes up. */ + md->msgq = g_slist_append( md->msgq, m ); + + /* FIXME: If the switchboard creation fails, the message will not be sent. */ + + return( 1 ); +} + struct msn_switchboard *msn_sb_create( struct im_connection *ic, char *host, int port, char *key, int session ) { struct msn_data *md = ic->proto_data; diff --git a/protocols/nogaim.c b/protocols/nogaim.c index 95d950ca..e6a89dfd 100644 --- a/protocols/nogaim.c +++ b/protocols/nogaim.c @@ -266,6 +266,10 @@ void imcb_connected( struct im_connection *ic ) /* Also necessary when we're not away, at least for some of the protocols. */ imc_set_away( ic, u->away ); + + /* Apparently we're connected successfully, so reset the + exponential backoff timer. */ + ic->acc->auto_reconnect_delay = 0; } gboolean auto_reconnect( gpointer data, gint fd, b_input_condition cond ) @@ -289,6 +293,7 @@ void imc_logout( struct im_connection *ic, int allow_reconnect ) irc_t *irc = ic->irc; user_t *t, *u; account_t *a; + int delay; /* Nested calls might happen sometimes, this is probably the best place to catch them. */ @@ -328,10 +333,9 @@ void imc_logout( struct im_connection *ic, int allow_reconnect ) /* Uhm... This is very sick. */ } else if( allow_reconnect && set_getbool( &irc->set, "auto_reconnect" ) && - set_getbool( &a->set, "auto_reconnect" ) ) + set_getbool( &a->set, "auto_reconnect" ) && + ( delay = account_reconnect_delay( a ) ) > 0 ) { - int delay = set_getint( &irc->set, "auto_reconnect_delay" ); - imcb_log( ic, "Reconnecting in %d seconds..", delay ); a->reconnect = b_timeout_add( delay * 1000, auto_reconnect, a ); } diff --git a/protocols/yahoo/libyahoo2.c b/protocols/yahoo/libyahoo2.c index a61955c4..897ba27b 100644 --- a/protocols/yahoo/libyahoo2.c +++ b/protocols/yahoo/libyahoo2.c @@ -68,6 +68,8 @@ char *strchr (), *strrchr (); #ifdef __MINGW32__ # include +# define write(a,b,c) send(a,b,c,0) +# define read(a,b,c) recv(a,b,c,0) #endif #include diff --git a/protocols/yahoo/yahoo.c b/protocols/yahoo/yahoo.c index 0db6e27a..8feb6639 100644 --- a/protocols/yahoo/yahoo.c +++ b/protocols/yahoo/yahoo.c @@ -665,9 +665,6 @@ void ext_yahoo_error( int id, const char *err, int fatal, int num ) struct im_connection *ic = byahoo_get_ic_by_id( id ); imcb_error( ic, "%s", err ); - - if( fatal ) - imc_logout( ic, TRUE ); } /* TODO: Clear up the mess of inp and d structures */ diff --git a/protocols/yahoo/yahoo_httplib.c b/protocols/yahoo/yahoo_httplib.c index 1b084992..dbbe2a84 100644 --- a/protocols/yahoo/yahoo_httplib.c +++ b/protocols/yahoo/yahoo_httplib.c @@ -50,6 +50,8 @@ char *strchr (), *strrchr (); #include "yahoo_debug.h" #ifdef __MINGW32__ # include +# define write(a,b,c) send(a,b,c,0) +# define read(a,b,c) recv(a,b,c,0) # define snprintf _snprintf #endif -- cgit v1.2.3 From a6b2f13e38e75e7bca00a1e6c1963783f244c0b2 Mon Sep 17 00:00:00 2001 From: Sven Moritz Hallberg Date: Thu, 3 Jun 2010 18:18:46 +0200 Subject: fix a double free --- protocols/nogaim.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'protocols') diff --git a/protocols/nogaim.c b/protocols/nogaim.c index f0c87c20..ebb00418 100644 --- a/protocols/nogaim.c +++ b/protocols/nogaim.c @@ -786,8 +786,8 @@ void imcb_buddy_msg( struct im_connection *ic, const char *handle, char *msg, ui ( ts = format_timestamp( irc, sent_at ) ) ) { char *new = g_strconcat( ts, msg, NULL ); - g_free( ts ); - ts = msg = new; + g_free( msg ); + msg = new; } wrapped = word_wrap( msg, 425 ); -- cgit v1.2.3 From 1dd34701541fb8142402f593dc256ff9b54121bb Mon Sep 17 00:00:00 2001 From: Sven Moritz Hallberg Date: Thu, 3 Jun 2010 23:47:53 +0200 Subject: add an option to disable otr on twitter (and other unsuitable protocols) --- protocols/nogaim.h | 9 +++++---- protocols/twitter/twitter.c | 1 + 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'protocols') diff --git a/protocols/nogaim.h b/protocols/nogaim.h index d3f5847f..62d800c6 100644 --- a/protocols/nogaim.h +++ b/protocols/nogaim.h @@ -58,6 +58,7 @@ #define OPT_LOCALBUDDY 0x00000020 /* For nicks local to one groupchat */ #define OPT_TYPING 0x00000100 /* Some pieces of code make assumptions */ #define OPT_THINKING 0x00000200 /* about these values... Stupid me! */ +#define OPT_NOOTR 0x00001000 /* protocol not suitable for OTR */ /* ok. now the fun begins. first we create a connection structure */ struct im_connection @@ -131,10 +132,10 @@ struct prpl { /* You should set this to the name of your protocol. * - The user sees this name ie. when imcb_log() is used. */ const char *name; - /* Maximum Message Size of this protocol. - * - Introduced for OTR, in order to fragment large protocol messages. - * - 0 means "unlimited". */ - unsigned int mms; + /* Maximum Message Size of this protocol. + * - Introduced for OTR, in order to fragment large protocol messages. + * - 0 means "unlimited". */ + unsigned int mms; /* Added this one to be able to add per-account settings, don't think * it should be used for anything else. You are supposed to use the diff --git a/protocols/twitter/twitter.c b/protocols/twitter/twitter.c index 98e85641..afa2fb32 100644 --- a/protocols/twitter/twitter.c +++ b/protocols/twitter/twitter.c @@ -335,6 +335,7 @@ void twitter_initmodule() { struct prpl *ret = g_new0(struct prpl, 1); + ret->options = OPT_NOOTR; ret->name = "twitter"; ret->login = twitter_login; ret->init = twitter_init; -- cgit v1.2.3