diff options
Diffstat (limited to 'protocols')
| -rw-r--r-- | protocols/jabber/jabber.c | 1 | ||||
| -rw-r--r-- | protocols/msn/msn.c | 1 | ||||
| -rw-r--r-- | protocols/msn/ns.c | 23 | ||||
| -rw-r--r-- | protocols/nogaim.c | 100 | ||||
| -rw-r--r-- | protocols/nogaim.h | 5 | ||||
| -rw-r--r-- | protocols/oscar/oscar.c | 1 | ||||
| -rw-r--r-- | protocols/yahoo/libyahoo2.c | 2 | ||||
| -rw-r--r-- | protocols/yahoo/yahoo.c | 1 | ||||
| -rw-r--r-- | protocols/yahoo/yahoo_httplib.c | 2 | 
9 files changed, 44 insertions, 92 deletions
| diff --git a/protocols/jabber/jabber.c b/protocols/jabber/jabber.c index b8e88c26..6f7e1c05 100644 --- a/protocols/jabber/jabber.c +++ b/protocols/jabber/jabber.c @@ -527,6 +527,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 046b2772..05eae541 100644 --- a/protocols/msn/msn.c +++ b/protocols/msn/msn.c @@ -316,6 +316,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/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/nogaim.c b/protocols/nogaim.c index 710b7645..645d7d82 100644 --- a/protocols/nogaim.c +++ b/protocols/nogaim.c @@ -660,10 +660,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; @@ -676,8 +675,18 @@ 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, "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 ); +		}  		g_free( from );  	}  } @@ -687,9 +696,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" ); @@ -699,6 +714,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 ) @@ -731,6 +747,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 ) @@ -971,66 +988,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( !is_bool( value ) ) -		return SET_INVALID; -	 -	st = bool2int( value ); -	 -	/* 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 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: */ @@ -1044,10 +1001,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;  } diff --git a/protocols/nogaim.h b/protocols/nogaim.h index 1e5df503..0229badf 100644 --- a/protocols/nogaim.h +++ b/protocols/nogaim.h @@ -131,6 +131,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 @@ -323,7 +327,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 ); diff --git a/protocols/oscar/oscar.c b/protocols/oscar/oscar.c index 1118c26d..bb9734c8 100644 --- a/protocols/oscar/oscar.c +++ b/protocols/oscar/oscar.c @@ -2666,6 +2666,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/libyahoo2.c b/protocols/yahoo/libyahoo2.c index a1755cc9..844ad7a8 100644 --- a/protocols/yahoo/libyahoo2.c +++ b/protocols/yahoo/libyahoo2.c @@ -68,6 +68,8 @@ char *strchr (), *strrchr ();  #ifdef __MINGW32__  # include <winsock2.h> +# define write(a,b,c) send(a,b,c,0) +# define read(a,b,c)  recv(a,b,c,0)  #endif  #include <stdlib.h> diff --git a/protocols/yahoo/yahoo.c b/protocols/yahoo/yahoo.c index ac57d4b6..40ecf347 100644 --- a/protocols/yahoo/yahoo.c +++ b/protocols/yahoo/yahoo.c @@ -368,6 +368,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; 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 <winsock2.h> +# define write(a,b,c) send(a,b,c,0) +# define read(a,b,c)  recv(a,b,c,0)  # define snprintf _snprintf  #endif | 
