From 1444be5c948f8b4509cfe3cb30992da74f12b5b8 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Wed, 17 Oct 2012 09:23:00 +0200 Subject: Implement jabber message receipts (XEP-0184) This change will make BitlBee acknowledge messages when requested. It will not request message receipts from other clients, mainly because I am not sure if this feature can be mapped to IRC cleanly. --- protocols/jabber/iq.c | 1 + protocols/jabber/jabber.h | 1 + protocols/jabber/message.c | 29 +++++++++++++++++++++++++++++ 3 files changed, 31 insertions(+) diff --git a/protocols/jabber/iq.c b/protocols/jabber/iq.c index b5a37a30..fa5104b1 100644 --- a/protocols/jabber/iq.c +++ b/protocols/jabber/iq.c @@ -127,6 +127,7 @@ xt_status jabber_pkt_iq( struct xt_node *node, gpointer data ) XMLNS_CHATSTATES, XMLNS_MUC, XMLNS_PING, + XMLNS_RECEIPTS, XMLNS_SI, XMLNS_BYTESTREAMS, XMLNS_FILETRANSFER, diff --git a/protocols/jabber/jabber.h b/protocols/jabber/jabber.h index d11d2fe8..fa0ca015 100644 --- a/protocols/jabber/jabber.h +++ b/protocols/jabber/jabber.h @@ -226,6 +226,7 @@ struct jabber_transfer #define XMLNS_TIME_OLD "jabber:iq:time" /* XEP-0090 */ #define XMLNS_TIME "urn:xmpp:time" /* XEP-0202 */ #define XMLNS_PING "urn:xmpp:ping" /* XEP-0199 */ +#define XMLNS_RECEIPTS "urn:xmpp:receipts" /* XEP-0184 */ #define XMLNS_VCARD "vcard-temp" /* XEP-0054 */ #define XMLNS_DELAY "jabber:x:delay" /* XEP-0091 */ #define XMLNS_XDATA "jabber:x:data" /* XEP-0004 */ diff --git a/protocols/jabber/message.c b/protocols/jabber/message.c index 85c71c9d..7792c5a3 100644 --- a/protocols/jabber/message.c +++ b/protocols/jabber/message.c @@ -23,17 +23,46 @@ #include "jabber.h" +static unsigned int next_receipt_id = 1; + xt_status jabber_pkt_message( struct xt_node *node, gpointer data ) { struct im_connection *ic = data; + struct jabber_data *jd = ic->proto_data; char *from = xt_find_attr( node, "from" ); char *type = xt_find_attr( node, "type" ); + char *id = xt_find_attr( node, "id" ); struct xt_node *body = xt_find_node( node->children, "body" ), *c; + struct xt_node *request = xt_find_node( node->children, "request" ); + struct xt_node *received, *receipt; struct jabber_buddy *bud = NULL; char *s, *room = NULL, *reason = NULL; if( !from ) return XT_HANDLED; /* Consider this packet corrupted. */ + + if( request && id ) + { + /* Send a message receipt (XEP-0184), looking like this: + * + * + * */ + received = xt_new_node( "received", NULL, NULL ); + xt_add_attr( received, "xmlns", XMLNS_RECEIPTS ); + xt_add_attr( received, "id", id ); + receipt = jabber_make_packet( "message", NULL, from, received ); + xt_add_attr( receipt, "from", jd->me ); + + char *id = g_strdup_printf( "%sRCPT%05x", JABBER_PACKET_ID, ( next_receipt_id++ ) & 0xfffff ); + xt_add_attr( receipt, "id", id ); + g_free( id ); + + jabber_write_packet( ic, receipt ); + xt_free_node( receipt ); + } bud = jabber_buddy_by_jid( ic, from, GET_BUDDY_EXACT ); -- cgit v1.2.3 From f21ad3756540aa93c786d1a3e00d927e659daa67 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Mon, 29 Oct 2012 00:16:12 +0000 Subject: Update authors files to reflect the current state of things. I'd like to thank Jelmer and Maurits for their past contributions. Also, list Miklos, pesco, Geert, ulim and Marijn who have done some substantial contributions (recently). --- debian/copyright | 4 ++-- doc/AUTHORS | 29 +++++++++++++++++++++-------- doc/bitlbee.8 | 4 ---- doc/user-guide/help.xml | 2 +- motd.txt | 2 +- 5 files changed, 25 insertions(+), 16 deletions(-) diff --git a/debian/copyright b/debian/copyright index a29a43b3..42f70d03 100644 --- a/debian/copyright +++ b/debian/copyright @@ -4,9 +4,9 @@ Mon, 8 Jul 2002 13:17:42 +0200. The source can be downloaded from http://www.bitlbee.org/ Authors: Wilmer van der Gaast, Sjoerd Hemminga, Jelmer Vernooij, - Maurits Dijkstra and others. + Maurits Dijkstra, Geert Mulders, Miklos Vajna and others. -Mainly Copyright 2002-2004 Wilmer van der Gaast. +Mainly Copyright 2002-2012 Wilmer van der Gaast. Some parts are borrowed from Gaim (version 0.58) . For the copyrights on those parts, please read the Gaim source code. diff --git a/doc/AUTHORS b/doc/AUTHORS index 6dab1040..3cc01570 100644 --- a/doc/AUTHORS +++ b/doc/AUTHORS @@ -1,19 +1,32 @@ -Current developers: +Core team: Wilmer van der Gaast Main developer -Jelmer 'ctrlsoft' Vernooij - Documentation, general hacking, Win32 port -Maurits Dijkstra - Daemon dude, plus some other stuff +Other contributors: +Miklos Vajna + Skype module -Retired developer: +pesco + OTR support + + +Retired developers: Sjoerd 'lucumo' Hemminga NickServ, documentation -The development team wishes to thank Sjoerd for his contributions to the -Bee. +Jelmer 'ctrlsoft' Vernooij + Documentation, general hacking, Win32 port + +Maurits Dijkstra + Daemon dude, plus some other stuff + +Geert Mulders + Initial version of the Twitter module + +ulim +Marijn Kruisselbrink + File transfer support diff --git a/doc/bitlbee.8 b/doc/bitlbee.8 index d01ec39e..62e6758f 100644 --- a/doc/bitlbee.8 +++ b/doc/bitlbee.8 @@ -113,7 +113,3 @@ Foundation, Inc., 59 Temple PLace, Suite 330, Boston, MA 02111-1307 USA .SH AUTHORS .PP Wilmer van der Gaast -.BR - Jelmer Vernooij -.BR - Maurits Dijkstra diff --git a/doc/user-guide/help.xml b/doc/user-guide/help.xml index 48ed8a48..e40a04d1 100644 --- a/doc/user-guide/help.xml +++ b/doc/user-guide/help.xml @@ -25,7 +25,7 @@ You can read more about them with help <subject> -BitlBee is written by Wilmer van der Gaast together with Jelmer Vernooij, Maurits Dijkstra and others. Bugs can be reported at http://bugs.bitlbee.org/. +Some more help can be found on http://wiki.bitlbee.org/. Bugs can be reported at http://bugs.bitlbee.org/. diff --git a/motd.txt b/motd.txt index 9e854d54..93249eb3 100644 --- a/motd.txt +++ b/motd.txt @@ -13,6 +13,6 @@ information. The developers of the Bee hope you have a buzzing time. -* BitlBee development team: wilmer, jelmer, Maurits +* BitlBee development team. ... Buzzing, haha, get it? -- cgit v1.2.3 From addad71d1dd6ac34dd00c2ee0d462f84f9cc2a84 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Tue, 30 Oct 2012 23:28:42 +0000 Subject: Debian packaging changes: Depend on different gnutls dev package. --- debian/changelog | 8 ++++++++ debian/control | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 915d3983..2e0d33e5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +bitlbee (3.0.6-2) UNRELEASED; urgency=low + + * Depend on gnutls-dev instead of libgnutls-dev. (Closes: #691766) + * Also, drop nss dependency. GnuTLS is supported officially, the rest is + use-at-your-own-risk (so compile it yourself). + + -- Wilmer van der Gaast Tue, 30 Oct 2012 23:25:56 +0000 + bitlbee (3.0.6-1) unstable; urgency=low * New upstream release. diff --git a/debian/control b/debian/control index 181feccb..1f92aa2c 100644 --- a/debian/control +++ b/debian/control @@ -4,7 +4,7 @@ Priority: optional Maintainer: Wilmer van der Gaast Uploaders: Jelmer Vernooij Standards-Version: 3.9.1 -Build-Depends: libglib2.0-dev (>= 2.4), libevent-dev, libgnutls-dev | libnss-dev (>= 1.6), po-debconf, libpurple-dev, libotr2-dev, debhelper (>= 6.0.7~), asciidoc +Build-Depends: libglib2.0-dev (>= 2.4), libevent-dev, gnutls-dev | libgnutls-dev, po-debconf, libpurple-dev, libotr2-dev, debhelper (>= 6.0.7~), asciidoc Homepage: http://www.bitlbee.org/ Vcs-Bzr: http://code.bitlbee.org/bitlbee/ DM-Upload-Allowed: yes -- cgit v1.2.3 From 8f976e69b218d89999cc4fd58721243380791fbe Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Tue, 30 Oct 2012 23:41:43 +0000 Subject: SSL fixes from Michal Suchanek. --- lib/ssl_gnutls.c | 8 +++++--- protocols/jabber/jabber.c | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/ssl_gnutls.c b/lib/ssl_gnutls.c index 93601ba6..41a76f09 100644 --- a/lib/ssl_gnutls.c +++ b/lib/ssl_gnutls.c @@ -84,8 +84,10 @@ void ssl_init( void ) { gnutls_certificate_set_x509_trust_file( xcred, global.conf->cafile, GNUTLS_X509_FMT_PEM ); - /* Not needed in GnuTLS 2.11+ but we support older versions for now. */ - gnutls_certificate_set_verify_flags( xcred, GNUTLS_VERIFY_ALLOW_X509_V1_CA_CRT ); + /* Not needed in GnuTLS 2.11+ (enabled by default there) so + don't do it (resets possible other defaults). */ + if( !gnutls_check_version( "2.11" ) ) + gnutls_certificate_set_verify_flags( xcred, GNUTLS_VERIFY_ALLOW_X509_V1_CA_CRT ); } initialized = TRUE; @@ -107,12 +109,12 @@ void *ssl_connect( char *host, int port, gboolean verify, ssl_input_function fun { struct scd *conn = g_new0( struct scd, 1 ); - conn->fd = proxy_connect( host, port, ssl_connected, conn ); conn->func = func; conn->data = data; conn->inpa = -1; conn->hostname = g_strdup( host ); conn->verify = verify && global.conf->cafile; + conn->fd = proxy_connect( host, port, ssl_connected, conn ); if( conn->fd < 0 ) { diff --git a/protocols/jabber/jabber.c b/protocols/jabber/jabber.c index 723894fe..b8d6f234 100644 --- a/protocols/jabber/jabber.c +++ b/protocols/jabber/jabber.c @@ -230,7 +230,7 @@ void jabber_connect( struct im_connection *ic ) non-standard ports... */ if( set_getbool( &acc->set, "ssl" ) ) { - jd->ssl = ssl_connect( connect_to, set_getint( &acc->set, "port" ), FALSE, jabber_connected_ssl, ic ); + jd->ssl = ssl_connect( connect_to, set_getint( &acc->set, "port" ), set_getbool( &acc->set, "tls_verify" ), jabber_connected_ssl, ic ); jd->fd = jd->ssl ? ssl_getfd( jd->ssl ) : -1; } else -- cgit v1.2.3 From 536dfa1e71dd9fbe90ea5be8b5b327ae2fed95fd Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Sun, 11 Nov 2012 22:13:07 +0000 Subject: Cleaning up struct im_connection a little bit. --- protocols/nogaim.h | 4 ---- protocols/oscar/oscar.c | 14 -------------- 2 files changed, 18 deletions(-) diff --git a/protocols/nogaim.h b/protocols/nogaim.h index eccf77da..0536ce69 100644 --- a/protocols/nogaim.h +++ b/protocols/nogaim.h @@ -87,11 +87,8 @@ struct im_connection GSList *deny; int permdeny; - char displayname[128]; char *away; - int evil; - /* BitlBee */ bee_t *bee; @@ -126,7 +123,6 @@ struct buddy { char name[80]; char show[BUDDY_ALIAS_MAXLEN]; int present; - int evil; time_t signon; time_t idle; int uc; diff --git a/protocols/oscar/oscar.c b/protocols/oscar/oscar.c index a5e177e9..0a1de519 100644 --- a/protocols/oscar/oscar.c +++ b/protocols/oscar/oscar.c @@ -946,9 +946,6 @@ static int gaim_parse_oncoming(aim_session_t *sess, aim_frame_t *fr, ...) { g_hash_table_insert(od->ips, uin, (gpointer) (long) info->icqinfo.ipaddr); } - if (!aim_sncmp(ic->acc->user, info->sn)) - g_snprintf(ic->displayname, sizeof(ic->displayname), "%s", info->sn); - tmp = normalize(info->sn); imcb_buddy_status(ic, tmp, flags, state_string, NULL); imcb_buddy_times(ic, tmp, signon, time_idle); @@ -1535,17 +1532,6 @@ static int gaim_parse_ratechange(aim_session_t *sess, aim_frame_t *fr, ...) { } static int gaim_selfinfo(aim_session_t *sess, aim_frame_t *fr, ...) { - va_list ap; - aim_userinfo_t *info; - struct im_connection *ic = sess->aux_data; - - va_start(ap, fr); - info = va_arg(ap, aim_userinfo_t *); - va_end(ap); - - ic->evil = info->warnlevel/10; - /* ic->correction_time = (info->onlinesince - ic->login_time); */ - return 1; } -- cgit v1.2.3 From e1d3f986ddad6140a25f3feffc9e28da8fc2318d Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Mon, 12 Nov 2012 14:45:38 +0000 Subject: Remove ssl_bogus.c, it really shouldn't be used anymore since it builds a next-to-useless binary. --- configure | 18 ++------------ lib/ssl_bogus.c | 76 --------------------------------------------------------- 2 files changed, 2 insertions(+), 92 deletions(-) delete mode 100644 lib/ssl_bogus.c diff --git a/configure b/configure index c1d64dd1..b6d7baa9 100755 --- a/configure +++ b/configure @@ -90,7 +90,7 @@ Option Description Default Disable/enable Skype support $skype --events=... Event handler (glib, libevent) $events ---ssl=... SSL library to use (gnutls, nss, openssl, bogus, auto) +--ssl=... SSL library to use (gnutls, nss, openssl, auto) $ssl @@ -432,19 +432,6 @@ elif [ "$ssl" = "openssl" ]; then echo 'EFLAGS+=-lssl -lcrypto' >> Makefile.settings - ret=1 -elif [ "$ssl" = "bogus" ]; then - echo - echo 'Using bogus SSL code. This means some features will not work properly.' - - ## Yes, you, at the console! How can you authenticate if you don't have any SSL!? - if [ "$msn" = "1" -o "$yahoo" = "1" ]; then - echo - echo 'WARNING: The MSN and Yahoo! modules will not work without SSL. Disabling.' - msn=0 - yahoo=0 - fi - ret=1 else echo @@ -456,8 +443,7 @@ if [ "$ret" = "0" ]; then echo echo 'ERROR: Could not find a suitable SSL library (GnuTLS, libnss or OpenSSL).' echo ' Please note that this script doesn'\''t have detection code for OpenSSL,' - echo ' so if you want to use that, you have to select it by hand. If you don'\''t' - echo ' need SSL support, you can select the "bogus" SSL library. (--ssl=bogus)' + echo ' so if you want to use that, you have to select it by hand.' exit 1 fi; diff --git a/lib/ssl_bogus.c b/lib/ssl_bogus.c deleted file mode 100644 index e134201d..00000000 --- a/lib/ssl_bogus.c +++ /dev/null @@ -1,76 +0,0 @@ - /********************************************************************\ - * BitlBee -- An IRC to other IM-networks gateway * - * * - * Copyright 2002-2004 Wilmer van der Gaast and others * - \********************************************************************/ - -/* SSL module - dummy version */ - -/* - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License with - the Debian GNU/Linux distribution in /usr/share/common-licenses/GPL; - if not, write to the Free Software Foundation, Inc., 59 Temple Place, - Suite 330, Boston, MA 02111-1307 USA -*/ - -#include "ssl_client.h" - -int ssl_errno; - -void ssl_init( void ) -{ -} - -void *ssl_connect( char *host, int port, gboolean verify, ssl_input_function func, gpointer data ) -{ - return( NULL ); -} - -int ssl_read( void *conn, char *buf, int len ) -{ - return( -1 ); -} - -int ssl_write( void *conn, const char *buf, int len ) -{ - return( -1 ); -} - -void ssl_disconnect( void *conn_ ) -{ -} - -int ssl_getfd( void *conn ) -{ - return( -1 ); -} - -void *ssl_starttls( int fd, char *hostname, gboolean verify, ssl_input_function func, gpointer data ) -{ - return NULL; -} - -b_input_condition ssl_getdirection( void *conn ) -{ - return B_EV_IO_READ; -} - -int ssl_pending( void *conn ) -{ - return 0; -} - -char *ssl_verify_strerror( int code ) -{ - return NULL; -} -- cgit v1.2.3