From c35143409dfd96e4a8a5de32063e73816b1b8de4 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Sat, 3 Jul 2010 22:32:10 +0100 Subject: Skip unsupported tags in user configs. (This should make downgrades from ui-fix for whatever reason less painful.) --- storage_xml.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/storage_xml.c b/storage_xml.c index 071fcd11..7321637c 100644 --- a/storage_xml.c +++ b/storage_xml.c @@ -59,6 +59,7 @@ struct xml_parsedata char *given_nick; char *given_pass; xml_pass_st pass_st; + int unknown_tag; }; static char *xml_attr( const gchar **attr_names, const gchar **attr_values, const gchar *key ) @@ -86,7 +87,11 @@ static void xml_start_element( GMarkupParseContext *ctx, const gchar *element_na struct xml_parsedata *xd = data; irc_t *irc = xd->irc; - if( g_strcasecmp( element_name, "user" ) == 0 ) + if( xd->unknown_tag > 0 ) + { + xd->unknown_tag ++; + } + else if( g_strcasecmp( element_name, "user" ) == 0 ) { char *nick = xml_attr( attr_names, attr_values, "nick" ); char *pass = xml_attr( attr_names, attr_values, "password" ); @@ -224,8 +229,15 @@ static void xml_start_element( GMarkupParseContext *ctx, const gchar *element_na } else { + xd->unknown_tag ++; + irc_usermsg( irc, "Warning: Unknown XML tag found in configuration file (%s). " + "This may happen when downgrading BitlBee versions. " + "This tag will be skipped and the information will be lost " + "once you save your settings.", element_name ); + /* g_set_error( error, G_MARKUP_ERROR, G_MARKUP_ERROR_UNKNOWN_ELEMENT, "Unkown element: %s", element_name ); + */ } } @@ -233,7 +245,11 @@ static void xml_end_element( GMarkupParseContext *ctx, const gchar *element_name { struct xml_parsedata *xd = data; - if( g_strcasecmp( element_name, "setting" ) == 0 && xd->current_setting ) + if( xd->unknown_tag > 0 ) + { + xd->unknown_tag --; + } + else if( g_strcasecmp( element_name, "setting" ) == 0 && xd->current_setting ) { g_free( xd->current_setting ); xd->current_setting = NULL; -- cgit v1.2.3 From 8eb0b76410b42490028448d22a26647faba6b916 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Sun, 4 Jul 2010 18:25:05 +0100 Subject: Document the base_url setting (for using other Twitter API services). --- doc/user-guide/commands.xml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/doc/user-guide/commands.xml b/doc/user-guide/commands.xml index e85dadf4..0cef37ce 100644 --- a/doc/user-guide/commands.xml +++ b/doc/user-guide/commands.xml @@ -483,6 +483,24 @@ + + http://twitter.com + + + + There are more services that understand the Twitter API than just Twitter.com. BitlBee can connect to all Twitter API implementations. + + + + For example, set this setting to http://identi.ca/api to use Identi.ca. + + + + Keep two things in mind: When not using Twitter, you must also disable the oauth setting as it currently only works with Twitter. If you're still having issues, make sure there is no slash at the end of the URL you enter here. + + + + false -- cgit v1.2.3 From 00540d40be63b4db537a661d1a17c49a1790f79c Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Sun, 4 Jul 2010 18:25:22 +0100 Subject: Ready for BitlBee 1.2.8. --- bitlbee.h | 4 ++-- doc/CHANGES | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/bitlbee.h b/bitlbee.h index 2f4fa6be..b89f77ce 100644 --- a/bitlbee.h +++ b/bitlbee.h @@ -34,10 +34,10 @@ #define _WIN32_WINNT 0x0501 #define PACKAGE "BitlBee" -#define BITLBEE_VERSION "1.2.7" +#define BITLBEE_VERSION "1.2.8" #define VERSION BITLBEE_VERSION #define BITLBEE_VER(a,b,c) (((a) << 16) + ((b) << 8) + (c)) -#define BITLBEE_VERSION_CODE BITLBEE_VER(1, 2, 7) +#define BITLBEE_VERSION_CODE BITLBEE_VER(1, 2, 8) #define MAX_STRING 511 diff --git a/doc/CHANGES b/doc/CHANGES index 7359a050..25db8a70 100644 --- a/doc/CHANGES +++ b/doc/CHANGES @@ -3,6 +3,25 @@ found in the bzr commit logs, for example you can try: http://bugs.bitlbee.org/bitlbee/timeline?daysback=90&changeset=on +Version 1.2.8: +- Now always using the AIM-style authentication method for OSCAR connections, + even when connecting to ICQ. This solves login issues some people were + having. (If you have problems, try changing the old_icq_auth setting.) +- Twitter: + * Allow changing the Twitter API base URL so the module can also be used + for identi.ca or any other compatible network. + * Fetch the full list of Twitter contacts instead of slowly adding all + contacts as they post a message. + * Fixed message length counting. + * Allow following/unfollowing people using the usual add/remove commands. + * Better error reporting. +- Added a user_agent setting to the Jabber module to get around artificial + client restrictions. +- Allow nick changes (although only before register/identify). +- Some more minor bugfixes/etc. + +Finished 4 Jul 2010 + Version 1.2.7: - Fixed problems with MSN Messenger authentication. ("Could not parse Passport server response") -- cgit v1.2.3 From a26af5c3cf58a5f896ee5af2061115e07a8eeb87 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Tue, 13 Jul 2010 21:13:46 +0100 Subject: Fixing NULL pointer dereferences in Twitter module. Based on patch from wahjava (bug #650). --- protocols/twitter/twitter_lib.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/protocols/twitter/twitter_lib.c b/protocols/twitter/twitter_lib.c index d1b65c26..05607164 100644 --- a/protocols/twitter/twitter_lib.c +++ b/protocols/twitter/twitter_lib.c @@ -65,6 +65,8 @@ static void twitter_groupchat_init(struct im_connection *ic); */ static void txu_free(struct twitter_xml_user *txu) { + if (txu == NULL) + return; g_free(txu->name); g_free(txu->screen_name); g_free(txu); @@ -88,6 +90,8 @@ static void txs_free(struct twitter_xml_status *txs) static void txl_free(struct twitter_xml_list *txl) { GSList *l; + if (txl == NULL) + return; for ( l = txl->list; l ; l = g_slist_next(l) ) if (txl->type == TXL_STATUS) txs_free((struct twitter_xml_status *)l->data); @@ -472,6 +476,9 @@ static void twitter_groupchat(struct im_connection *ic, GSList *list) for ( l = list; l ; l = g_slist_next(l) ) { status = l->data; + if (status->user == NULL || status->text == NULL) + continue; + twitter_add_buddy(ic, status->user->screen_name, status->user->name); strip_html(status->text); @@ -735,4 +742,4 @@ void twitter_friendships_create_destroy(struct im_connection *ic, char *who, int args[0] = "screen_name"; args[1] = who; twitter_http(ic, create ? TWITTER_FRIENDSHIPS_CREATE_URL : TWITTER_FRIENDSHIPS_DESTROY_URL, twitter_http_post, ic, 1, args, 2); -} \ No newline at end of file +} -- cgit v1.2.3 From e693ac27b08e60c325223a0797dbf49ed2dbc3b3 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Thu, 15 Jul 2010 23:15:47 +0100 Subject: Debian package 1.2.8-1. --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/changelog b/debian/changelog index ca592229..e720a1d4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +bitlbee (1.2.8-1) unstable; urgency=low + + * New upstream version. + + -- Wilmer van der Gaast Sat, 10 Jul 2010 13:54:55 +0100 + bitlbee (1.2.7-1) unstable; urgency=high * New upstream version. -- cgit v1.2.3 From e4e0b3764761c8e204bfdf169d83af950d9e6340 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Thu, 15 Jul 2010 23:16:42 +0100 Subject: Fix compatibility with older GLib versions again. (Bug #643, patch from Robert Scheck.) --- protocols/twitter/twitter_lib.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/protocols/twitter/twitter_lib.c b/protocols/twitter/twitter_lib.c index 05607164..0578c5e0 100644 --- a/protocols/twitter/twitter_lib.c +++ b/protocols/twitter/twitter_lib.c @@ -35,6 +35,14 @@ #include #include +/* GLib < 2.12.0 doesn't have g_ascii_strtoll(), work around using system strtoll(). */ +/* GLib < 2.12.4 can be buggy: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=488013 */ +#if !GLIB_CHECK_VERSION(2,12,5) +#include +#include +#define g_ascii_strtoll strtoll +#endif + #define TXL_STATUS 1 #define TXL_USER 2 #define TXL_ID 3 -- cgit v1.2.3 From 7885d0f3dc255cd7900ee1d398366636c48bcda1 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Fri, 16 Jul 2010 00:23:04 +0100 Subject: Don't be a dumbass and stop following redirects if there doesn't seem to be an end. --- lib/http_client.c | 3 ++- lib/http_client.h | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/http_client.c b/lib/http_client.c index aae5645b..dd5f5563 100644 --- a/lib/http_client.c +++ b/lib/http_client.c @@ -66,6 +66,7 @@ void *http_dorequest( char *host, int port, int ssl, char *request, http_input_f req->data = data; req->request = g_strdup( request ); req->request_length = strlen( request ); + req->redir_ttl = 3; return( req ); } @@ -310,7 +311,7 @@ got_reply: req->status_code = -1; } - if( req->status_code == 301 || req->status_code == 302 ) + if( ( req->status_code == 301 || req->status_code == 302 ) && req->redir_ttl-- > 0 ) { char *loc, *new_request, *new_host; int error = 0, new_port, new_proto; diff --git a/lib/http_client.h b/lib/http_client.h index d73894a4..726c97a6 100644 --- a/lib/http_client.h +++ b/lib/http_client.h @@ -60,6 +60,8 @@ struct http_request int body_size; /* The number of bytes in reply_body. */ int finished; /* Set to non-0 if the request was completed successfully. */ + int redir_ttl; /* You can set it to 0 if you don't want + http_client to follow them. */ http_input_function func; gpointer data; -- cgit v1.2.3 From 516a9c69222bed3d6fee7aefb439b461e4173da0 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Sat, 17 Jul 2010 00:11:37 +0100 Subject: No idea why http_dorequest() ever returned void*. Don't hide the type, it's not a secret (the pointer is shared with a type later anyway). --- lib/http_client.c | 7 ++++--- lib/http_client.h | 6 ++---- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/lib/http_client.c b/lib/http_client.c index dd5f5563..529be578 100644 --- a/lib/http_client.c +++ b/lib/http_client.c @@ -34,9 +34,10 @@ static gboolean http_connected( gpointer data, int source, b_input_condition cond ); static gboolean http_ssl_connected( gpointer data, void *source, b_input_condition cond ); static gboolean http_incoming_data( gpointer data, int source, b_input_condition cond ); +static void http_free( struct http_request *req ); -void *http_dorequest( char *host, int port, int ssl, char *request, http_input_function func, gpointer data ) +struct http_request *http_dorequest( char *host, int port, int ssl, char *request, http_input_function func, gpointer data ) { struct http_request *req; int error = 0; @@ -71,7 +72,7 @@ void *http_dorequest( char *host, int port, int ssl, char *request, http_input_f return( req ); } -void *http_dorequest_url( char *url_string, http_input_function func, gpointer data ) +struct http_request *http_dorequest_url( char *url_string, http_input_function func, gpointer data ) { url_t *url = g_new0( url_t, 1 ); char *request; @@ -445,7 +446,7 @@ cleanup: return FALSE; } -void http_free( struct http_request *req ) +static void http_free( struct http_request *req ) { g_free( req->request ); g_free( req->reply_headers ); diff --git a/lib/http_client.h b/lib/http_client.h index 726c97a6..27c484ff 100644 --- a/lib/http_client.h +++ b/lib/http_client.h @@ -80,7 +80,5 @@ struct http_request version is probably only useful if you want to do POST requests or if you want to add some extra headers. As you can see, HTTPS connections are also supported (using ssl_client). */ -void *http_dorequest( char *host, int port, int ssl, char *request, http_input_function func, gpointer data ); -void *http_dorequest_url( char *url_string, http_input_function func, gpointer data ); - -void http_free( struct http_request *req ); +struct http_request *http_dorequest( char *host, int port, int ssl, char *request, http_input_function func, gpointer data ); +struct http_request *http_dorequest_url( char *url_string, http_input_function func, gpointer data ); -- cgit v1.2.3 From ef14a83adbb9036c0006ad460c5e11882a3d7e13 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Sat, 17 Jul 2010 00:14:04 +0100 Subject: WTF AOL, now suddenly underscores are not allowed in room names? --- protocols/oscar/oscar.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/protocols/oscar/oscar.c b/protocols/oscar/oscar.c index 9602a496..f98fbe6f 100644 --- a/protocols/oscar/oscar.c +++ b/protocols/oscar/oscar.c @@ -2520,7 +2520,7 @@ struct groupchat *oscar_chat_with(struct im_connection * ic, char *who) static int chat_id = 0; char * chatname; - chatname = g_strdup_printf("%s%s_%d", isdigit(*ic->acc->user) ? "icq_" : "", + chatname = g_strdup_printf("%s%s%d", isdigit(*ic->acc->user) ? "icq" : "", ic->acc->user, chat_id++); ret = oscar_chat_join(ic, chatname, NULL, NULL); -- cgit v1.2.3