diff options
-rw-r--r-- | Makefile | 24 | ||||
-rwxr-xr-x | configure | 12 | ||||
-rw-r--r-- | doc/user-guide/commands.xml | 6 | ||||
-rw-r--r-- | doc/user-guide/quickstart.xml | 2 | ||||
-rw-r--r-- | lib/misc.c | 8 | ||||
-rw-r--r-- | lib/proxy.c | 1 | ||||
-rw-r--r-- | otr.c | 104 | ||||
-rw-r--r-- | configure @@ -35,6 +35,7 @@ strip=1 gcov=0 plugins=1 otr=0 +skype=0 events=glib ldap=0 @@ -82,6 +83,8 @@ Option Description Default --plugins=0/1 Disable/enable plugins support $plugins --otr=0/1/auto/plugin Disable/enable OTR encryption support $otr +--skype=0/1/plugin + Disable/enable Skype support $skype --events=... Event handler (glib, libevent) $events --ssl=... SSL library to use (gnutls, nss, openssl, bogus, auto) @@ -109,6 +112,8 @@ pidfile=`eval echo "$pidfile" | sed 's/\/\{1,\}/\//g'` ipcsocket=`eval echo "$ipcsocket" | sed 's/\/\{1,\}/\//g'` pcdir=`eval echo "$pcdir" | sed 's/\/\{1,\}/\//g'` +protocols_mods="" + cat<<EOF>Makefile.settings ## BitlBee settings, generated by configure PREFIX=$prefix @@ -537,6 +542,11 @@ elif [ "$otr" = "plugin" ]; then echo 'OTR_PI=otr.so' >> Makefile.settings fi +if [ "$skype" = "1" -o "$skype" = "plugin" ]; then + echo 'SKYPE_PI=skype.so' >> Makefile.settings + protocols_mods="$protocol_mods skype(plugin)" +fi + if [ ! -e doc/user-guide/help.txt ] && ! type xmlto > /dev/null 2> /dev/null; then echo echo 'WARNING: Building from an unreleased source tree without prebuilt helpfile.' @@ -750,7 +760,7 @@ echo ' Using SSL library: '$ssl #echo ' Building with these storage backends: '$STORAGES if [ -n "$protocols" ]; then - echo ' Building with these protocols:' $protocols + echo ' Building with these protocols:' $protocols$protocols_mods case "$protocols" in *purple*) echo " Note that BitlBee-libpurple is supported on a best-effort basis. It's" diff --git a/doc/user-guide/commands.xml b/doc/user-guide/commands.xml index 74310d5e..60e1cf61 100644 --- a/doc/user-guide/commands.xml +++ b/doc/user-guide/commands.xml @@ -851,9 +851,9 @@ </para> <variablelist> - <varlistentry><term>undo [<id>]</term><listitem><para>Delete your last Tweet (or one with the given ID)</para></listitem></varlistentry> - <varlistentry><term>rt <screenname|id></term><listitem><para>Retweet someone's last Tweet (or one with the given ID)</para></listitem></varlistentry> - <varlistentry><term>reply <screenname|id></term><listitem><para>Reply to a Tweet (with a reply-to reference)</para></listitem></varlistentry> + <varlistentry><term>undo #[<id>]</term><listitem><para>Delete your last Tweet (or one with the given ID)</para></listitem></varlistentry> + <varlistentry><term>rt <screenname|#id></term><listitem><para>Retweet someone's last Tweet (or one with the given ID)</para></listitem></varlistentry> + <varlistentry><term>reply <screenname|#id></term><listitem><para>Reply to a Tweet (with a reply-to reference)</para></listitem></varlistentry> <varlistentry><term>follow <screenname></term><listitem><para>Start following a person</para></listitem></varlistentry> <varlistentry><term>unfollow <screenname></term><listitem><para>Stop following a person</para></listitem></varlistentry> <varlistentry><term>post <message></term><listitem><para>Post a tweet</para></listitem></varlistentry> diff --git a/doc/user-guide/quickstart.xml b/doc/user-guide/quickstart.xml index 46bbfc47..dcd389a8 100644 --- a/doc/user-guide/quickstart.xml +++ b/doc/user-guide/quickstart.xml @@ -121,7 +121,7 @@ With multiple channel support you can have contacts for specific protocols in th </para> <para> -Account tagging allows you to use the given account name rather than a number when referencing your account. If you wish to turn off your gtalk account, you may <emphasis>account off gtalk</emphasis> rather than <emphasis>account off 3</emphasis> where "3" is the account number. +Account tagging allows you to use the given account name rather than a number when referencing your account. If you wish to turn off your gtalk account, you may <emphasis>account gtalk off</emphasis> rather than <emphasis>account 3 off</emphasis> where "3" is the account number. </para> <para> @@ -399,7 +399,7 @@ signed int do_iconv( char *from_cs, char *to_cs, char *src, char *dst, size_t si cd = g_iconv_open( to_cs, from_cs ); if( cd == (GIConv) -1 ) - return( -1 ); + return -1; inbytesleft = size ? size : strlen( src ); outbytesleft = maxbuf - 1; @@ -407,10 +407,10 @@ signed int do_iconv( char *from_cs, char *to_cs, char *src, char *dst, size_t si *outbuf = '\0'; g_iconv_close( cd ); - if( res == (size_t) -1 ) - return( -1 ); + if( res != 0 ) + return -1; else - return( outbuf - dst ); + return outbuf - dst; } /* A pretty reliable random number generator. Tries to use the /dev/random diff --git a/lib/proxy.c b/lib/proxy.c index b79afea4..3e5c9d49 100644 --- a/lib/proxy.c +++ b/lib/proxy.c @@ -84,6 +84,7 @@ static gboolean gaim_io_connected(gpointer data, gint source, b_input_condition b_event_remove(phb->inpa); closesocket(source); dup2(new_fd, source); + closesocket(new_fd); phb->inpa = b_input_add(source, B_EV_IO_WRITE, gaim_io_connected, phb); return FALSE; } @@ -7,7 +7,7 @@ /* OTR support (cf. http://www.cypherpunks.ca/otr/) - (c) 2008-2010 Sven Moritz Hallberg <pesco@khjk.org> + (c) 2008-2011 Sven Moritz Hallberg <pesco@khjk.org> (c) 2008 funded by stonedcoder.org files used to store OTR data: @@ -162,6 +162,9 @@ void otr_handle_smp(struct im_connection *ic, const char *handle, OtrlTLV *tlvs) void otr_smp_or_smpq(irc_t *irc, const char *nick, const char *question, const char *secret); +/* update flags within the irc_user structure to reflect OTR status of context */ +void otr_update_uflags(ConnContext *context, irc_user_t *u); + /* update op/voice flag of given user according to encryption state and settings returns 0 if neither op_buddies nor voice_buddies is set to "encrypted", i.e. msgstate should be announced seperately */ @@ -236,6 +239,8 @@ gboolean otr_irc_new(irc_t *irc) l = g_slist_prepend( l, "manual" ); l = g_slist_prepend( l, "always" ); s->eval_data = l; + + s = set_add( &irc->b->set, "otr_does_html", "true", set_eval_bool, irc ); return TRUE; } @@ -384,26 +389,38 @@ char *otr_filter_msg_in(irc_user_t *iu, char *msg, int flags) /* OTR has processed this message */ ConnContext *context = otrl_context_find(irc->otr->us, iu->bu->handle, ic->acc->user, ic->acc->prpl->name, 0, NULL, NULL, NULL); - if(context && context->msgstate == OTRL_MSGSTATE_ENCRYPTED && - set_getbool(&ic->bee->set, "otr_color_encrypted")) { - /* color according to f'print trust */ - int color; - const char *trust = context->active_fingerprint->trust; - if(trust && trust[0] != '\0') - color=3; /* green */ - else - color=5; /* red */ - - if(newmsg[0] == ',') { - /* could be a problem with the color code */ - /* insert a space between color spec and message */ - colormsg = g_strdup_printf("\x03%.2d %s\x0F", color, newmsg); - } else { - colormsg = g_strdup_printf("\x03%.2d%s\x0F", color, newmsg); + + if(context && context->msgstate == OTRL_MSGSTATE_ENCRYPTED) { + /* HTML decoding */ + /* perform any necessary stripping that the top level would miss */ + if(set_getbool(&ic->bee->set, "otr_does_html") && + !(ic->flags & OPT_DOES_HTML) && + set_getbool(&ic->bee->set, "strip_html")) { + strip_html(newmsg); + } + + /* coloring */ + if(set_getbool(&ic->bee->set, "otr_color_encrypted")) { + /* color according to f'print trust */ + int color; + const char *trust = context->active_fingerprint->trust; + if(trust && trust[0] != '\0') + color=3; /* green */ + else + color=5; /* red */ + + if(newmsg[0] == ',') { + /* could be a problem with the color code */ + /* insert a space between color spec and message */ + colormsg = g_strdup_printf("\x03%.2d %s\x0F", color, newmsg); + } else { + colormsg = g_strdup_printf("\x03%.2d%s\x0F", color, newmsg); + } } } else { colormsg = g_strdup(newmsg); } + otrl_message_free(newmsg); return colormsg; } @@ -421,6 +438,13 @@ char *otr_filter_msg_out(irc_user_t *iu, char *msg, int flags) if(ic->acc->prpl->options & OPT_NOOTR) { return msg; } + + /* HTML encoding */ + /* consider OTR plaintext to be HTML if otr_does_html is set */ + if(set_getbool(&ic->bee->set, "otr_does_html") && + (g_strncasecmp(msg, "<html>", 6) != 0)) { + msg = escape_html(msg); + } |