Changeset 1522faf


Ignore:
Timestamp:
2015-04-06T02:26:44Z (9 years ago)
Author:
dequis <dx@…>
Children:
d16e951
Parents:
71f87ba (diff), 69982f8 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
git-author:
dequis <dx@…> (06-04-15 02:24:35)
git-committer:
dequis <dx@…> (06-04-15 02:26:44)
Message:

Merge branch 'develop' into feat/hip-cat

Conflicts:

irc_im.c
protocols/jabber/conference.c

Files:
13 edited

Legend:

Unmodified
Added
Removed
  • Makefile

    r71f87ba r1522faf  
    159159        x=$$(basename $$(pwd)); \
    160160        cd ..; \
    161         tar czf $$x.tar.gz --exclude-from=.gitignore $$x
     161        tar czf $$x.tar.gz --exclude=debian --exclude=.git* --exclude=.depend $$x
    162162
    163163$(subdirs):
  • bitlbee.h

    r71f87ba r1522faf  
    3636
    3737#define PACKAGE "BitlBee"
    38 #define BITLBEE_VERSION "3.2.2"
     38#define BITLBEE_VERSION "3.4"
    3939#define VERSION BITLBEE_VERSION
    4040#define BITLBEE_VER(a, b, c) (((a) << 16) + ((b) << 8) + (c))
    41 #define BITLBEE_VERSION_CODE BITLBEE_VER(3, 2, 2)
     41#define BITLBEE_VERSION_CODE BITLBEE_VER(3, 4, 0)
    4242
    4343#define MAX_STRING 511
  • doc/CHANGES

    r71f87ba r1522faf  
    11This ChangeLog mostly lists changes relevant to users. A full log can be
    2 found in the bzr commit logs, for example you can try:
    3 
    4 http://bugs.bitlbee.org/bitlbee/timeline?daysback=90&changeset=on
     2found in the git commit logs, for example you can try:
     3
     4https://github.com/bitlbee/bitlbee/commits/master
     5
     6Version 3.4:
     7- First release pretty much fully prepared by dx instead of Wilmer. Just look
     8  at the tightly structured changelog!
     9- Main repository migrated from bzr to git
     10- Some API/ABI changes. Recompiling third party plugins is required!
     11- Important bugfixes:
     12  * Fix memory leak when calling word_wrap() on groupchat messages (dx)
     13  * Fix segfault after a file transfer is complete (dx)
     14  * Fix bug where NSS would refuse to work in forkdaemon mode (dx)
     15  * Fix several bugs with UTF8 nicks (dx)
     16  * Fix some nasty deadlocks that appared mostly with libpurple (dx)
     17- General changes:
     18  * Add a 'pattern' parameter to the blist command, to filter it (tribut)
     19  * Implemented /kick support, only supported by purple for now (jgeboski)
     20  * Add a "special" state to show_users (mapped to the % prefix) (jgeboski)
     21  * Improved support for cygwin, openbsd and darwin (jcopenha)
     22  * Create temporary users instead of showing "Message from unknown
     23    participant" (jgeboski)
     24- purple:
     25  * Local contact lists for gadugadu and whatsapp (dx)
     26  * Add topic and name_hint to groupchats (seirl)
     27  * Support for 'input' requests (such as telegram auth codes) (seirl)
     28    Note that telegram-purple itself is rather unstable ATM, it may crash.
     29- jabber:
     30  * Handle compressed DNS responses in SRV lookup (jcopenha)
     31  * Fix case sensitivity issues with JIDs (GRMrGecko, dx)
     32  * Implement XEP-0203 style message timestamps (dx)
     33  * Fix "Server claims your JID is X instead of Y" warnings (dx)
     34  * Account-wide display_name setting, mostly for hipchat (dx)
     35- twitter:
     36  * Filter channels. Search by keyword/hashtag or a list of users (jgeboski)
     37  * Fix bug in "reply" command which removed the first quote character (dx)
     38  * Add "rawreply" command, like reply but bitlbee won't add @mention (WillP)
     39  * Add support for The United States of America (favorite/fav aliases) (dx)
     40  * Default show_old_mentions to 0 (dx)
     41  * Start stream from last tweet on connect/reconnect (roger)
     42- msn:
     43  * Disabled module by default. The protocol we used (MSNP18) stopped working
     44    last week. This is being worked on, but it's far from ready for release.
     45- And lots of small bugfixes, too many to list here.
     46
     47Finished 25 Mar 2015
    548
    649Version 3.2.2:
  • doc/user-guide/misc.xml

    r71f87ba r1522faf  
    409409</sect1>
    410410
     411<sect1 id="whatsnew030400">
     412<title>New stuff in BitlBee 3.4</title>
     413
     414<para>
     415Lots of bugfixes! <emphasis>Important:</emphasis> Recompiling third party plugins such as bitlbee-steam or bitlbee-facebook is <emphasis>required</emphasis>!
     416</para>
     417
     418<simplelist>
     419        <member><emphasis>twitter:</emphasis> Filter channels - Search by keyword/hashtag or a list of users. See the <emphasis>HowtoTwitter</emphasis> wiki page for more details!</member>
     420        <member><emphasis>twitter:</emphasis> Add "rawreply" command, like reply but bitlbee won't add @mention. Also add "favorite" / "fav" command aliases.</member>
     421        <member><emphasis>twitter:</emphasis> Start stream from last tweet on connect/reconnect to avoid showing duplicate tweets</member>
     422        <member><emphasis>jabber:</emphasis> Fixed crashes with file transfers (they still fail at bypassing NATs, but at least they fail without crashing)</member>
     423        <member><emphasis>purple:</emphasis> Improved support for gadugadu, whatsapp and telegram.</member>
     424        <member><emphasis>msn:</emphasis> disabled in this release since the protocol we used (MSNP18) stopped working.</member>
     425        <member>Add a 'pattern' parameter to the blist command, to filter it.</member>
     426        <member>The <emphasis>utf8_nicks</emphasis> setting should be more reliable now.</member>
     427</simplelist>
     428
     429<para>
     430See the full changelog for details!
     431</para>
     432
     433</sect1>
     434
    411435</chapter>
  • irc_channel.c

    r71f87ba r1522faf  
    588588char *irc_channel_name_gen(bee_t *bee, const char *hint)
    589589{
    590         char name[MAX_NICK_LENGTH + 1] = { 0 };
    591 
    592         name[0] = '#';
    593         strncpy(name + 1, hint, MAX_NICK_LENGTH - 1);
    594         name[MAX_NICK_LENGTH] = '\0';
     590        char *name, *final_name;
     591        gsize bytes_written;
     592
     593        name = g_convert_with_fallback(hint, -1, "ASCII//TRANSLIT", "UTF-8", "", NULL, &bytes_written, NULL);
     594        if (bytes_written > MAX_NICK_LENGTH) {
     595                name[MAX_NICK_LENGTH] = '\0';
     596        }
    595597
    596598        irc_channel_name_strip(name);
    597599
    598600        if (set_getbool(&bee->set, "lcnicks")) {
    599                 nick_lc(bee->ui_data, name + 1);
     601                nick_lc(bee->ui_data, name);
    600602        }
    601603
     
    604606        }
    605607
    606         return g_strdup(name);
     608        final_name = g_strconcat("#", name, NULL);
     609
     610        g_free(name);
     611
     612        return final_name;
    607613}
    608614
  • irc_im.c

    r71f87ba r1522faf  
    235235                        } else {
    236236                                /* Modules can swallow messages. */
    237                                 return TRUE;
     237                                goto cleanup;
    238238                        }
    239239                }
     
    250250        wrapped = word_wrap(msg, 425);
    251251        irc_send_msg(iu, "PRIVMSG", dst, wrapped, prefix);
    252 
    253252        g_free(wrapped);
     253
     254cleanup:
    254255        g_free(prefix);
    255256        g_free(msg);
     
    291292
    292293        irc_send_msg((irc_user_t *) bu->ui_data, "NOTICE", irc->user->nick, msg->str, NULL);
     294
     295        g_string_free(msg, TRUE);
    293296
    294297        return TRUE;
  • lib/proxy.c

    r71f87ba r1522faf  
    6363static int proxy_connect_none(const char *host, unsigned short port_, struct PHB *phb);
    6464
    65 static gboolean gaim_io_connected(gpointer data, gint source, b_input_condition cond)
     65static gboolean phb_close(struct PHB *phb)
     66{
     67        close(phb->fd);
     68        phb->func(phb->data, -1, B_EV_IO_READ);
     69        g_free(phb->host);
     70        g_free(phb);
     71        return FALSE;
     72}
     73
     74static gboolean proxy_connected(gpointer data, gint source, b_input_condition cond)
    6675{
    6776        struct PHB *phb = data;
     
    8089                                dup2(new_fd, source);
    8190                                closesocket(new_fd);
    82                                 phb->inpa = b_input_add(source, B_EV_IO_WRITE, gaim_io_connected, phb);
     91                                phb->inpa = b_input_add(source, B_EV_IO_WRITE, proxy_connected, phb);
    8392                                return FALSE;
    8493                        }
    8594                }
    86                 freeaddrinfo(phb->gai);
    8795                closesocket(source);
    88                 b_event_remove(phb->inpa);
    89                 phb->inpa = 0;
    90                 if (phb->proxy_func) {
    91                         phb->proxy_func(phb->proxy_data, -1, B_EV_IO_READ);
    92                 } else {
    93                         phb->func(phb->data, -1, B_EV_IO_READ);
    94                         g_free(phb);
    95                 }
    96                 return FALSE;
    97         }
     96                source = -1;
     97                /* socket is dead, but continue to clean up */
     98        } else {
     99                sock_make_blocking(source);
     100        }
     101
    98102        freeaddrinfo(phb->gai);
    99         sock_make_blocking(source);
    100103        b_event_remove(phb->inpa);
    101104        phb->inpa = 0;
     
    160163                        continue;
    161164                } else {
    162                         phb->inpa = b_input_add(fd, B_EV_IO_WRITE, gaim_io_connected, phb);
     165                        phb->inpa = b_input_add(fd, B_EV_IO_WRITE, proxy_connected, phb);
    163166                        phb->fd = fd;
    164167
     
    206209        }
    207210
    208         close(source);
    209         phb->func(phb->data, -1, B_EV_IO_READ);
    210         g_free(phb->host);
    211         g_free(phb);
    212 
    213         return FALSE;
     211        return phb_close(phb);
    214212}
    215213
     
    226224        len = sizeof(error);
    227225        if (getsockopt(source, SOL_SOCKET, SO_ERROR, &error, &len) < 0) {
    228                 close(source);
    229                 phb->func(phb->data, -1, B_EV_IO_READ);
    230                 g_free(phb->host);
    231                 g_free(phb);
    232                 return FALSE;
     226                return phb_close(phb);
    233227        }
    234228        sock_make_blocking(source);
     
    237231                   phb->host, phb->port);
    238232        if (send(source, cmd, strlen(cmd), 0) < 0) {
    239                 close(source);
    240                 phb->func(phb->data, -1, B_EV_IO_READ);
    241                 g_free(phb->host);
    242                 g_free(phb);
    243                 return FALSE;
     233                return phb_close(phb);
    244234        }
    245235
     
    252242                g_free(t2);
    253243                if (send(source, cmd, strlen(cmd), 0) < 0) {
    254                         close(source);
    255                         phb->func(phb->data, -1, B_EV_IO_READ);
    256                         g_free(phb->host);
    257                         g_free(phb);
    258                         return FALSE;
     244                        return phb_close(phb);
    259245                }
    260246        }
     
    262248        g_snprintf(cmd, sizeof(cmd), "\r\n");
    263249        if (send(source, cmd, strlen(cmd), 0) < 0) {
    264                 close(source);
    265                 phb->func(phb->data, -1, B_EV_IO_READ);
    266                 g_free(phb->host);
    267                 g_free(phb);
    268                 return FALSE;
     250                return phb_close(phb);
    269251        }
    270252
     
    302284        }
    303285
    304         close(source);
    305         phb->func(phb->data, -1, B_EV_IO_READ);
    306         g_free(phb->host);
    307         g_free(phb);
    308 
    309         return FALSE;
     286        return phb_close(phb);
    310287}
    311288
     
    323300        len = sizeof(error);
    324301        if (getsockopt(source, SOL_SOCKET, SO_ERROR, &error, &len) < 0) {
    325                 close(source);
    326                 phb->func(phb->data, -1, B_EV_IO_READ);
    327                 g_free(phb->host);
    328                 g_free(phb);
    329                 return FALSE;
     302                return phb_close(phb);
    330303        }
    331304        sock_make_blocking(source);
     
    333306        /* XXX does socks4 not support host name lookups by the proxy? */
    334307        if (!(hp = gethostbyname(phb->host))) {
    335                 close(source);
    336                 phb->func(phb->data, -1, B_EV_IO_READ);
    337                 g_free(phb->host);
    338                 g_free(phb);
    339                 return FALSE;
     308                return phb_close(phb);
    340309        }
    341310
     
    350319        packet[8] = 0;
    351320        if (write(source, packet, 9) != 9) {
    352                 close(source);
    353                 phb->func(phb->data, -1, B_EV_IO_READ);
    354                 g_free(phb->host);
    355                 g_free(phb);
    356                 return FALSE;
     321                return phb_close(phb);
    357322        }
    358323
     
    383348
    384349        if (read(source, buf, 10) < 10) {
    385                 close(source);
    386                 phb->func(phb->data, -1, B_EV_IO_READ);
    387                 g_free(phb->host);
    388                 g_free(phb);
    389                 return FALSE;
     350                return phb_close(phb);
    390351        }
    391352        if ((buf[0] != 0x05) || (buf[1] != 0x00)) {
    392                 close(source);
    393                 phb->func(phb->data, -1, B_EV_IO_READ);
    394                 g_free(phb->host);
    395                 g_free(phb);
    396                 return FALSE;
     353                return phb_close(phb);
    397354        }
    398355
     
    420377
    421378        if (write(source, buf, (5 + strlen(phb->host) + 2)) < (5 + strlen(phb->host) + 2)) {
    422                 close(source);
    423                 phb->func(phb->data, -1, B_EV_IO_READ);
    424                 g_free(phb->host);
    425                 g_free(phb);
     379                phb_close(phb);
    426380                return;
    427381        }
     
    438392
    439393        if (read(source, buf, 2) < 2) {
    440                 close(source);
    441                 phb->func(phb->data, -1, B_EV_IO_READ);
    442                 g_free(phb->host);
    443                 g_free(phb);
    444                 return FALSE;
     394                return phb_close(phb);
    445395        }
    446396
    447397        if ((buf[0] != 0x01) || (buf[1] != 0x00)) {
    448                 close(source);
    449                 phb->func(phb->data, -1, B_EV_IO_READ);
    450                 g_free(phb->host);
    451                 g_free(phb);
    452                 return FALSE;
     398                return phb_close(phb);
    453399        }
    454400
     
    466412
    467413        if (read(source, buf, 2) < 2) {
    468                 close(source);
    469                 phb->func(phb->data, -1, B_EV_IO_READ);
    470                 g_free(phb->host);
    471                 g_free(phb);
    472                 return FALSE;
     414                return phb_close(phb);
    473415        }
    474416
    475417        if ((buf[0] != 0x05) || (buf[1] == 0xff)) {
    476                 close(source);
    477                 phb->func(phb->data, -1, B_EV_IO_READ);
    478                 g_free(phb->host);
    479                 g_free(phb);
    480                 return FALSE;
     418                return phb_close(phb);
    481419        }
    482420
     
    489427                memcpy(buf + 2 + i + 1, proxypass, j);
    490428                if (write(source, buf, 3 + i + j) < 3 + i + j) {
    491                         close(source);
    492                         phb->func(phb->data, -1, B_EV_IO_READ);
    493                         g_free(phb->host);
    494                         g_free(phb);
    495                         return FALSE;
     429                        return phb_close(phb);
    496430                }
    497431
     
    517451        len = sizeof(error);
    518452        if (getsockopt(source, SOL_SOCKET, SO_ERROR, &error, &len) < 0) {
    519                 close(source);
    520                 phb->func(phb->data, -1, B_EV_IO_READ);
    521                 g_free(phb->host);
    522                 g_free(phb);
    523                 return FALSE;
     453                return phb_close(phb);
    524454        }
    525455        sock_make_blocking(source);
     
    539469
    540470        if (write(source, buf, i) < i) {
    541                 close(source);
    542                 phb->func(phb->data, -1, B_EV_IO_READ);
    543                 g_free(phb->host);
    544                 g_free(phb);
    545                 return FALSE;
     471                return phb_close(phb);
    546472        }
    547473
  • lib/ssl_gnutls.c

    r71f87ba r1522faf  
    124124
    125125        if (conn->fd < 0) {
     126                g_free(conn->hostname);
    126127                g_free(conn);
    127128                return NULL;
     
    314315        if (source == -1) {
    315316                conn->func(conn->data, 0, NULL, cond);
     317                g_free(conn->hostname);
    316318                g_free(conn);
    317319                return FALSE;
     
    355357                        conn->func(conn->data, 0, NULL, cond);
    356358
    357                         gnutls_deinit(conn->session);
    358                         closesocket(conn->fd);
    359 
    360                         g_free(conn);
     359                        ssl_disconnect(conn);
    361360                }
    362361        } else {
     
    364363                        conn->func(conn->data, stver, NULL, cond);
    365364
    366                         gnutls_deinit(conn->session);
    367                         closesocket(conn->fd);
    368 
    369                         g_free(conn);
     365                        ssl_disconnect(conn);
    370366                } else {
    371367                        /* For now we can't handle non-blocking perfectly everywhere... */
  • otr.c

    r71f87ba r1522faf  
    287287void otr_irc_free(irc_t *irc)
    288288{
     289        set_t *s;
    289290        otr_t *otr = irc->otr;
    290291
     
    292293        b_event_remove(otr->timer);
    293294        otrl_userstate_free(otr->us);
     295
     296        s = set_find(&irc->b->set, "otr_policy");
     297        g_slist_free(s->eval_data);
     298
    294299        if (otr->keygen) {
    295300                kill(otr->keygen, SIGTERM);
     
    434439                                            ic->acc->user, ic->acc->prpl->name, iu->bu->handle, msg, &newmsg,
    435440                                            &tlvs, NULL, NULL, NULL);
     441
     442        if (tlvs) {
     443                otrl_tlv_free(tlvs);
     444        }
    436445
    437446        if (ignore_msg) {
     
    472481                /* libotr wants us to replace our message */
    473482                /* NB: caller will free old msg */
    474                 msg = g_strdup(otrmsg);
     483                msg = st ? NULL : g_strdup(otrmsg);
    475484                otrl_message_free(otrmsg);
    476485        }
     
    13251334
    13261335        log_message(LOGLVL_INFO, "otr: %s", msg);
     1336
     1337        g_free(msg);
    13271338}
    13281339
     
    20752086        }
    20762087}
    2077 
    2078 /* vim: set noet ts=4 sw=4: */
  • protocols/jabber/jabber_util.c

    r71f87ba r1522faf  
    566566
    567567        if ((s = strchr(jid, '=')) == NULL) {
     568                g_free(jid);
    568569                return NULL;
    569570        }
  • protocols/msn/msn_util.c

    r71f87ba r1522faf  
    174174};
    175175
    176 static void msn_buddy_ask_yes(void *data)
     176static void msn_buddy_ask_free(void *data)
    177177{
    178178        struct msn_buddy_ask_data *bla = data;
    179 
    180         msn_buddy_list_add(bla->ic, MSN_BUDDY_AL, bla->handle, bla->realname, NULL);
    181 
    182         imcb_ask_add(bla->ic, bla->handle, NULL);
    183179
    184180        g_free(bla->handle);
     
    187183}
    188184
     185static void msn_buddy_ask_yes(void *data)
     186{
     187        struct msn_buddy_ask_data *bla = data;
     188
     189        msn_buddy_list_add(bla->ic, MSN_BUDDY_AL, bla->handle, bla->realname, NULL);
     190
     191        imcb_ask_add(bla->ic, bla->handle, NULL);
     192
     193        msn_buddy_ask_free(bla);
     194}
     195
    189196static void msn_buddy_ask_no(void *data)
    190197{
     
    193200        msn_buddy_list_add(bla->ic, MSN_BUDDY_BL, bla->handle, bla->realname, NULL);
    194201
    195         g_free(bla->handle);
    196         g_free(bla->realname);
    197         g_free(bla);
     202        msn_buddy_ask_free(bla);
    198203}
    199204
     
    216221                   "The user %s (%s) wants to add you to his/her buddy list.",
    217222                   bu->handle, bu->fullname);
    218         imcb_ask(bu->ic, buf, bla, msn_buddy_ask_yes, msn_buddy_ask_no);
     223
     224        imcb_ask_with_free(bu->ic, buf, bla, msn_buddy_ask_yes, msn_buddy_ask_no, msn_buddy_ask_free);
    219225}
    220226
  • protocols/nogaim.c

    r71f87ba r1522faf  
    498498};
    499499
    500 static void imcb_ask_auth_cb_no(void *data)
     500static void imcb_ask_cb_free(void *data)
    501501{
    502502        struct imcb_ask_cb_data *cbd = data;
    503 
    504         cbd->ic->acc->prpl->auth_deny(cbd->ic, cbd->handle);
    505503
    506504        g_free(cbd->handle);
     
    508506}
    509507
     508static void imcb_ask_auth_cb_no(void *data)
     509{
     510        struct imcb_ask_cb_data *cbd = data;
     511
     512        cbd->ic->acc->prpl->auth_deny(cbd->ic, cbd->handle);
     513
     514        imcb_ask_cb_free(cbd);
     515}
     516
    510517static void imcb_ask_auth_cb_yes(void *data)
    511518{
     
    514521        cbd->ic->acc->prpl->auth_allow(cbd->ic, cbd->handle);
    515522
    516         g_free(cbd->handle);
    517         g_free(cbd);
     523        imcb_ask_cb_free(cbd);
    518524}
    519525
     
    535541        data->handle = g_strdup(handle);
    536542        query_add((irc_t *) ic->bee->ui_data, ic, s,
    537                   imcb_ask_auth_cb_yes, imcb_ask_auth_cb_no, g_free, data);
    538 }
    539 
    540 
    541 static void imcb_ask_add_cb_no(void *data)
    542 {
    543         g_free(((struct imcb_ask_cb_data*) data)->handle);
    544         g_free(data);
     543                  imcb_ask_auth_cb_yes, imcb_ask_auth_cb_no, imcb_ask_cb_free, data);
     544
     545        g_free(s);
    545546}
    546547
     
    551552        cbd->ic->acc->prpl->add_buddy(cbd->ic, cbd->handle, NULL);
    552553
    553         imcb_ask_add_cb_no(data);
     554        imcb_ask_cb_free(data);
    554555}
    555556
    556557void imcb_ask_add(struct im_connection *ic, const char *handle, const char *realname)
    557558{
    558         struct imcb_ask_cb_data *data = g_new0(struct imcb_ask_cb_data, 1);
     559        struct imcb_ask_cb_data *data;
    559560        char *s;
    560561
     
    564565        }
    565566
     567        data = g_new0(struct imcb_ask_cb_data, 1);
     568
    566569        s = g_strdup_printf("The user %s is not in your buddy list yet. Do you want to add him/her now?", handle);
    567570
     
    569572        data->handle = g_strdup(handle);
    570573        query_add((irc_t *) ic->bee->ui_data, ic, s,
    571                   imcb_ask_add_cb_yes, imcb_ask_add_cb_no, g_free, data);
     574                  imcb_ask_add_cb_yes, imcb_ask_cb_free, imcb_ask_cb_free, data);
     575
     576        g_free(s);
    572577}
    573578
  • storage_xml.c

    r71f87ba r1522faf  
    128128                }
    129129        } else {
     130                g_free(pass_cr);
     131                g_free(password);
    130132                return XT_ABORT;
    131133        }
Note: See TracChangeset for help on using the changeset viewer.