Changeset f5c0d8e


Ignore:
Timestamp:
2010-08-31T20:06:14Z (14 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
0c85c08
Parents:
8358691 (diff), 31dbb90a (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.
Message:

Merge mainline stuff.

Files:
1 added
3 deleted
26 edited

Legend:

Unmodified
Added
Removed
  • .bzrignore

    r8358691 rf5c0d8e  
    2020bitlbee.info
    2121bitlbee.exe
     22.depend
  • Makefile

    r8358691 rf5c0d8e  
    5252
    5353distclean: clean $(subdirs)
     54        rm -rf .depend
    5455        rm -f Makefile.settings config.h bitlbee.pc
    5556        find . -name 'DEADJOE' -o -name '*.orig' -o -name '*.rej' -o -name '*~' -exec rm -f {} \;
     57        @# May still be present in dirs of disabled protocols.
     58        find . -name .depend | xargs -r rmdir
    5659        $(MAKE) -C tests distclean
    5760
     
    105108        x=$$(basename $$(pwd)); \
    106109        cd ..; \
    107         tar czf $$x.tar.gz --exclude=debian --exclude=.bzr* $$x
     110        tar czf $$x.tar.gz --exclude=debian --exclude=.bzr* --exclude=.depend $$x
    108111
    109112$(subdirs):
     
    131134helloworld:
    132135        @echo Hello World
     136
     137-include .depend/*.d
  • configure

    r8358691 rf5c0d8e  
    595595fi
    596596
     597case "$CC" in
     598*gcc* )
     599        echo CFLAGS+=-MD -MF .depend/\$@.d >> Makefile.settings
     600        for i in . lib protocols protocols/*/; do
     601                mkdir -p $i/.depend
     602        done
     603esac
     604
    597605if [ "$msn" = 0 ]; then
    598606        echo '#undef WITH_MSN' >> config.h
  • doc/user-guide/commands.xml

    r8358691 rf5c0d8e  
    7373                                       
    7474                                        <para>
    75                                                 By default all your Twitter contacts will come from a contact called twitter_(yourusername). You can change this behaviour using the <emphasis>mode</emphasis> setting (see <emphasis>help set mode</emphasis>).
     75                                                By default all your Twitter contacts will appear in a new channel called #twitter_yourusername. You can change this behaviour using the <emphasis>mode</emphasis> setting (see <emphasis>help set mode</emphasis>).
    7676                                        </para>
    7777                                       
     
    970970        <bitlbee-setting name="mode" type="string" scope="account">
    971971                <possible-values>one, many, chat</possible-values>
    972                 <default>one</default>
    973 
    974                 <description>
    975                         <para>
    976                                 By default, everything from the Twitter module will come from one nick, twitter_(yourusername). If you prefer to have individual nicks for everyone, you can set this setting to "many" instead.
    977                         </para>
    978                        
    979                         <para>
    980                                 If you prefer to have all your Twitter things in a separate channel, you can set this setting to "chat".
    981                         </para>
    982                        
    983                         <para>
    984                                 In the last two modes, you can send direct messages by /msg'ing your contacts directly. Note, however, that incoming DMs are not fetched yet.
     972                <default>chat</default>
     973
     974                <description>
     975                        <para>
     976                                By default, BitlBee will create a separate channel (called #twitter_yourusername) for all your Twitter contacts/messages.
     977                        </para>
     978
     979                        <para>
     980                                If you don't want an extra channel, you can set this setting to "one" (everything will come from one nick, twitter_yourusername), or to "many" (individual nicks for everyone).
     981                        </para>
     982                       
     983                        <para>
     984                                With modes "chat" and "many", you can send direct messages by /msg'ing your contacts directly. Note, however, that incoming DMs are not fetched yet.
     985                        </para>
     986                       
     987                        <para>
     988                                With modes "many" and "one", you can post tweets by /msg'ing the twitter_yourusername contact. In mode "chat", messages posted in the Twitter channel will also be posted as tweets.
    985989                        </para>
    986990                </description>
     
    16371641        </bitlbee-command>
    16381642       
    1639         <bitlbee-command name="transfers">
     1643        <bitlbee-command name="transfer">
    16401644                <short-description>Monitor, cancel, or reject file transfers</short-description>
    1641                 <syntax>transfers [&lt;cancel&gt; id | &lt;reject&gt;]</syntax>
     1645                <syntax>transfer [&lt;cancel&gt; id | &lt;reject&gt;]</syntax>
    16421646               
    16431647                <description>
    16441648                        <para>
    1645                                 Without parameters the currently pending file transfers and their status will be listed. Available actions are <emphasis>cancel</emphasis> and <emphasis>reject</emphasis>. See <emphasis>help transfers &lt;action&gt;</emphasis> for more information.
     1649                                Without parameters the currently pending file transfers and their status will be listed. Available actions are <emphasis>cancel</emphasis> and <emphasis>reject</emphasis>. See <emphasis>help transfer &lt;action&gt;</emphasis> for more information.
    16461650                        </para>
    16471651
    16481652                        <ircexample>
    1649                                 <ircline nick="ulim">transfers</ircline>
     1653                                <ircline nick="ulim">transfer</ircline>
    16501654                        </ircexample>
    16511655                </description>
     
    16531657                <bitlbee-command name="cancel">
    16541658                        <short-description>Cancels the file transfer with the given id</short-description>
    1655                         <syntax>transfers &lt;cancel&gt; id</syntax>
     1659                        <syntax>transfer &lt;cancel&gt; id</syntax>
    16561660
    16571661                        <description>
     
    16601664
    16611665                        <ircexample>
    1662                                 <ircline nick="ulim">transfers cancel 1</ircline>
     1666                                <ircline nick="ulim">transfer cancel 1</ircline>
    16631667                                <ircline nick="root">Canceling file transfer for test</ircline>
    16641668                        </ircexample>
     
    16671671                <bitlbee-command name="reject">
    16681672                        <short-description>Rejects all incoming transfers</short-description>
    1669                         <syntax>transfers &lt;reject&gt;</syntax>
     1673                        <syntax>transfer &lt;reject&gt;</syntax>
    16701674
    16711675                        <description>
     
    16741678
    16751679                        <ircexample>
    1676                                 <ircline nick="ulim">transfers reject</ircline>
     1680                                <ircline nick="ulim">transfer reject</ircline>
    16771681                        </ircexample>
    16781682                </bitlbee-command>
  • irc.h

    r8358691 rf5c0d8e  
    289289void irc_send_channel_user_mode_diff( irc_channel_t *ic, irc_user_t *iu,
    290290                                      irc_channel_user_flags_t old, irc_channel_user_flags_t new );
     291void irc_send_invite( irc_user_t *iu, irc_channel_t *ic );
    291292
    292293/* irc_user.c */
  • irc_commands.c

    r8358691 rf5c0d8e  
    302302        char *channel = cmd[1];
    303303        irc_channel_t *ic;
     304        irc_user_t *iu;
    304305       
    305306        if( !channel || *channel == '0' || *channel == '*' || !*channel )
     
    307308        else if( ( ic = irc_channel_by_name( irc, channel ) ) )
    308309                irc_send_who( irc, ic->users, channel );
     310        else if( ( iu = irc_user_by_name( irc, channel ) ) )
     311        {
     312                /* Tiny hack! */
     313                GSList *l = g_slist_append( NULL, iu );
     314                irc_send_who( irc, l, channel );
     315                g_slist_free( l );
     316        }
    309317        else
    310318                irc_send_num( irc, 403, "%s :No such channel", channel );
  • irc_im.c

    r8358691 rf5c0d8e  
    252252{
    253253        irc_user_t *iu = (irc_user_t *) bu->ui_data;
    254         irc_t *irc = (irc_t *) bee->ui_data;
    255254        char *s;
    256255       
     
    266265        if( ( bu->ic->flags & OPT_LOGGED_IN ) && set_getbool( &bee->set, "display_namechanges" ) )
    267266        {
     267                /* People don't like this /NOTICE. Meh, let's go back to the old one.
    268268                char *msg = g_strdup_printf( "<< \002BitlBee\002 - Changed name to `%s' >>", iu->fullname );
    269269                irc_send_msg( iu, "NOTICE", irc->user->nick, msg, NULL );
     270                */
     271                imcb_log( bu->ic, "User `%s' changed name to `%s'", iu->nick, iu->fullname );
    270272        }
    271273       
     
    613615}
    614616
     617static gboolean bee_irc_chat_invite( bee_t *bee, bee_user_t *bu, const char *name, const char *msg )
     618{
     619        char *channel, *s;
     620        irc_t *irc = bee->ui_data;
     621        irc_user_t *iu = bu->ui_data;
     622        irc_channel_t *chan;
     623       
     624        if( strchr( CTYPES, name[0] ) )
     625                channel = g_strdup( name );
     626        else
     627                channel = g_strdup_printf( "#%s", name );
     628       
     629        if( ( s = strchr( channel, '@' ) ) )
     630                *s = '\0';
     631       
     632        if( strlen( channel ) > MAX_NICK_LENGTH )
     633        {
     634                /* If the channel name is very long (like those insane GTalk
     635                   UUID names), try if we can use the inviter's nick. */
     636                s = g_strdup_printf( "#%s", iu->nick );
     637                if( irc_channel_by_name( irc, s ) == NULL )
     638                {
     639                        g_free( channel );
     640                        channel = s;
     641                }
     642        }
     643       
     644        if( ( chan = irc_channel_new( irc, channel ) ) &&
     645            set_setstr( &chan->set, "type", "chat" ) &&
     646            set_setstr( &chan->set, "chat_type", "room" ) &&
     647            set_setstr( &chan->set, "account", bu->ic->acc->tag ) &&
     648            set_setstr( &chan->set, "room", (char*) name ) )
     649        {
     650                /* I'm assuming that if the user didn't "chat add" the room
     651                   himself but got invited, it's temporary, so make this a
     652                   temporary mapping that is removed as soon as we /PART. */
     653                chan->flags |= IRC_CHANNEL_TEMP;
     654        }
     655        else
     656        {
     657                irc_channel_free( chan );
     658                chan = NULL;
     659        }
     660        g_free( channel );
     661       
     662        irc_send_msg_f( iu, "PRIVMSG", irc->user->nick, "<< \002BitlBee\002 - Invitation to chatroom %s >>", name );
     663        if( msg )
     664                irc_send_msg( iu, "PRIVMSG", irc->user->nick, msg, NULL );
     665        if( chan )
     666        {
     667                irc_send_msg_f( iu, "PRIVMSG", irc->user->nick, "To join the room, just /join %s", chan->name );
     668                irc_send_invite( iu, chan );
     669        }
     670       
     671        return TRUE;
     672}
     673
    615674/* IRC->IM */
    616675static gboolean bee_irc_channel_chat_privmsg_cb( gpointer data, gint fd, b_input_condition cond );
     
    909968        bee_irc_chat_topic,
    910969        bee_irc_chat_name_hint,
     970        bee_irc_chat_invite,
    911971       
    912972        bee_irc_ft_in_start,
  • irc_send.c

    r8358691 rf5c0d8e  
    264264void irc_send_who( irc_t *irc, GSList *l, const char *channel )
    265265{
    266         gboolean is_channel = strcmp( channel, "**" ) != 0;
     266        gboolean is_channel = strchr( CTYPES, channel[0] ) != NULL;
    267267       
    268268        while( l )
     
    273273                /* TODO(wilmer): Restore away/channel information here */
    274274                irc_send_num( irc, 352, "%s %s %s %s %s %c :0 %s",
    275                               channel ? : "*", iu->user, iu->host, irc->root->host,
     275                              is_channel ? channel : "*", iu->user, iu->host, irc->root->host,
    276276                              iu->nick, iu->flags & IRC_USER_AWAY ? 'G' : 'H',
    277277                              iu->fullname );
     
    398398                irc_write( ic->irc, ":%s MODE %s %s", from, ic->name, changes );
    399399}
     400
     401void irc_send_invite( irc_user_t *iu, irc_channel_t *ic )
     402{
     403        irc_t *irc = iu->irc;
     404       
     405        irc_write( iu->irc, ":%s!%s@%s INVITE %s :%s",
     406                   iu->nick, iu->user, iu->host, irc->user->nick, ic->name );
     407}
  • lib/Makefile

    r8358691 rf5c0d8e  
    3030
    3131distclean: clean $(subdirs)
     32        rm -rf .depend
    3233
    3334### MAIN PROGRAM
     
    4243        @echo '*' Compiling $<
    4344        @$(CC) -c $(CFLAGS) $< -o $@
     45
     46-include .depend/*.d
  • protocols/Makefile

    r8358691 rf5c0d8e  
    4040
    4141distclean: clean $(subdirs)
     42        rm -rf .depend
    4243
    4344$(subdirs):
     
    5556        @echo '*' Compiling $<
    5657        @$(CC) -c $(CFLAGS) $< -o $@
     58
     59-include .depend/*.d
  • protocols/bee.h

    r8358691 rf5c0d8e  
    123123        gboolean (*chat_topic)( bee_t *bee, struct groupchat *c, const char *new, bee_user_t *bu );
    124124        gboolean (*chat_name_hint)( bee_t *bee, struct groupchat *c, const char *name );
     125        gboolean (*chat_invite)( bee_t *bee, bee_user_t *bu, const char *name, const char *msg );
    125126       
    126127        struct file_transfer* (*ft_in_start)( bee_t *bee, bee_user_t *bu, const char *file_name, size_t file_size );
     
    175176G_MODULE_EXPORT int bee_chat_msg( bee_t *bee, struct groupchat *c, const char *msg, int flags );
    176177G_MODULE_EXPORT struct groupchat *bee_chat_by_title( bee_t *bee, struct im_connection *ic, const char *title );
     178G_MODULE_EXPORT void imcb_chat_invite( struct im_connection *ic, const char *name, const char *who, const char *msg );
    177179
    178180#endif /* __BEE_H__ */
  • protocols/bee_chat.c

    r8358691 rf5c0d8e  
    233233        return NULL;
    234234}
     235
     236void imcb_chat_invite( struct im_connection *ic, const char *name, const char *who, const char *msg )
     237{
     238        bee_user_t *bu = bee_user_by_handle( ic->bee, ic, who );
     239       
     240        if( bu && ic->bee->ui->chat_invite )
     241                ic->bee->ui->chat_invite( ic->bee, bu, name, msg );
     242}
  • protocols/jabber/Makefile

    r8358691 rf5c0d8e  
    3030
    3131distclean: clean
     32        rm -rf .depend
    3233
    3334### MAIN PROGRAM
     
    4243        @echo '*' Linking jabber_mod.o
    4344        @$(LD) $(LFLAGS) $(objects) -o jabber_mod.o
     45
     46-include .depend/*.d
  • protocols/jabber/jabber.h

    r8358691 rf5c0d8e  
    5959        JBFLAG_IS_ANONYMOUS = 8,        /* For anonymous chatrooms, when we don't have
    6060                                           have a real JID. */
     61        JBFLAG_HIDE_SUBJECT = 16,       /* Hide the subject field since we probably
     62                                           showed it already. */
    6163} jabber_buddy_flags_t;
    6264
  • protocols/jabber/message.c

    r8358691 rf5c0d8e  
    3131        struct xt_node *body = xt_find_node( node->children, "body" ), *c;
    3232        struct jabber_buddy *bud = NULL;
    33         char *s;
     33        char *s, *room = NULL, *reason = NULL;
    3434       
    3535        if( !from )
     
    5252                for( c = node->children; ( c = xt_find_node( c, "x" ) ); c = c->next )
    5353                {
    54                         char *ns = xt_find_attr( c, "xmlns" ), *room;
    55                         struct xt_node *inv, *reason;
     54                        char *ns = xt_find_attr( c, "xmlns" );
     55                        struct xt_node *inv;
    5656                       
    5757                        if( ns && strcmp( ns, XMLNS_MUC_USER ) == 0 &&
    5858                            ( inv = xt_find_node( c->children, "invite" ) ) )
    5959                        {
     60                                /* This is an invitation. Set some vars which
     61                                   will be passed to imcb_chat_invite() below. */
    6062                                room = from;
    6163                                if( ( from = xt_find_attr( inv, "from" ) ) == NULL )
    6264                                        from = room;
    63 
    64                                 g_string_append_printf( fullmsg, "<< \002BitlBee\002 - Invitation to chatroom %s >>\n", room );
    65                                 if( ( reason = xt_find_node( inv->children, "reason" ) ) && reason->text_len > 0 )
    66                                         g_string_append( fullmsg, reason->text );
     65                                if( ( inv = xt_find_node( inv->children, "reason" ) ) && inv->text_len > 0 )
     66                                        reason = inv->text;
    6767                        }
    6868                }
     
    9393                        }
    9494                }
    95                 else if( ( c = xt_find_node( node->children, "subject" ) ) && c->text_len > 0 )
     95                else if( ( c = xt_find_node( node->children, "subject" ) ) && c->text_len > 0 &&
     96                         ( !bud || !( bud->flags & JBFLAG_HIDE_SUBJECT ) ) )
    9697                {
    9798                        g_string_append_printf( fullmsg, "<< \002BitlBee\002 - Message with subject: %s >>\n", c->text );
     99                        if( bud )
     100                                bud->flags |= JBFLAG_HIDE_SUBJECT;
     101                }
     102                else if( bud && !c )
     103                {
     104                        /* Yeah, possibly we're hiding changes to this field now. But nobody uses
     105                           this for anything useful anyway, except GMail when people reply to an
     106                           e-mail via chat, repeating the same subject all the time. I don't want
     107                           to have to remember full subject strings for everyone. */
     108                        bud->flags &= ~JBFLAG_HIDE_SUBJECT;
    98109                }
    99110               
     
    104115                        imcb_buddy_msg( ic, from, fullmsg->str,
    105116                                        0, jabber_get_timestamp( node ) );
     117                if( room )
     118                        imcb_chat_invite( ic, room, from, reason );
    106119               
    107120                g_string_free( fullmsg, TRUE );
  • protocols/jabber/si.c

    r8358691 rf5c0d8e  
    262262                                break;
    263263                        }
     264                        else
     265                        {
     266                                c = c->next;
     267                        }
    264268
    265269                if ( !requestok )
  • protocols/msn/Makefile

    r8358691 rf5c0d8e  
    3030
    3131distclean: clean
     32        rm -rf .depend
    3233
    3334### MAIN PROGRAM
     
    4243        @echo '*' Linking msn_mod.o
    4344        @$(LD) $(LFLAGS) $(objects) -o msn_mod.o
    44        
    4545
     46-include .depend/*.d
  • protocols/oscar/Makefile

    r8358691 rf5c0d8e  
    3131
    3232distclean: clean
     33        rm -rf .depend
    3334
    3435### MAIN PROGRAM
     
    4344        @echo '*' Linking oscar_mod.o
    4445        @$(LD) $(LFLAGS) $(objects) -o oscar_mod.o
     46
     47-include .depend/*.d
  • protocols/oscar/oscar.c

    r8358691 rf5c0d8e  
    517517                        /* Incorrect nick/password */
    518518                        imcb_error(ic, _("Incorrect nickname or password."));
     519                        {
     520                                int max = od->icq ? 8 : 16;
     521                                if (strlen(ic->acc->pass) > max)
     522                                        imcb_log(ic, "Note that the maximum password "
     523                                                 "length supported by this protocol is "
     524                                                 "%d characters, try logging in using "
     525                                                 "a shorter password.", max);
     526                        }
    519527//                      plugin_event(event_error, (void *)980, 0, 0, 0);
    520528                        break;
  • protocols/purple/Makefile

    r8358691 rf5c0d8e  
    3131
    3232distclean: clean
     33        rm -rf .depend
    3334
    3435### MAIN PROGRAM
     
    4344        @echo '*' Linking purple_mod.o
    4445        $(LD) $(LFLAGS) $(objects) -o purple_mod.o
     46
     47-include .depend/*.d
  • protocols/twitter/Makefile

    r8358691 rf5c0d8e  
    3030
    3131distclean: clean
     32        rm -rf .depend
    3233
    3334### MAIN PROGRAM
     
    4344        @$(LD) $(LFLAGS) $(objects) -o twitter_mod.o
    4445       
    45 
     46-include .depend/*.d
  • protocols/twitter/twitter.c

    r8358691 rf5c0d8e  
    195195        s = set_add( &acc->set, "message_length", "140", set_eval_int, acc );
    196196       
    197         s = set_add( &acc->set, "mode", "one", set_eval_mode, acc );
     197        s = set_add( &acc->set, "mode", "chat", set_eval_mode, acc );
    198198        s->flags |= ACC_SET_OFFLINE_ONLY;
    199199       
  • protocols/yahoo/Makefile

    r8358691 rf5c0d8e  
    3131
    3232distclean: clean
     33        rm -rf .depend
    3334
    3435### MAIN PROGRAM
     
    4344        @echo '*' Linking yahoo_mod.o
    4445        @$(LD) $(LFLAGS) $(objects) -o yahoo_mod.o
     46
     47-include .depend/*.d
  • protocols/yahoo/libyahoo2.c

    r8358691 rf5c0d8e  
    21692169        yd->buddies = y_list_append(yd->buddies, bud);
    21702170
     2171#if 0
     2172        /* BitlBee: This seems to be wrong in my experience. I think:
     2173           status = 0: Success
     2174           status = 2: Already on list
     2175           status = 3: Doesn't exist
     2176           status = 42: Invalid handle (possibly banned/reserved, I get it for
     2177                        handles like joe or jjjjjj)
     2178           Haven't seen others yet. But whenever the add is successful, there
     2179           will be a separate "went online" packet when the auth. request is
     2180           accepted. Couldn't find any test account that doesn't require auth.
     2181           unfortunately (if there is even such a thing?) */
     2182           
    21712183        /* A non-zero status (i've seen 2) seems to mean the buddy is already
    21722184         * added and is online */
     
    21762188                YAHOO_CALLBACK(ext_yahoo_status_changed) (yd->client_id, who,
    21772189                        YAHOO_STATUS_AVAILABLE, NULL, 0, 0, 0);
     2190        }
     2191#endif
     2192        /* BitlBee: Need ACK of added buddy, if it was successful. */
     2193        if (status == 0) {
     2194                YList *tmp = y_list_append(NULL, bud);
     2195                YAHOO_CALLBACK(ext_yahoo_got_buddies) (yd->client_id, tmp);
     2196                y_list_free(tmp);
    21782197        }
    21792198}
  • root_commands.c

    r8358691 rf5c0d8e  
    12841284}
    12851285
     1286static void cmd_nick( irc_t *irc, char **cmd )
     1287{
     1288        irc_usermsg( irc, "This command is deprecated. Try: account %s set display_name", cmd[1] );
     1289}
     1290
    12861291/* Maybe this should be a stand-alone command as well? */
    12871292static void bitlbee_whatsnew( irc_t *irc )
     
    13381343        { "identify",       1, cmd_identify,       0 },
    13391344        { "info",           1, cmd_info,           0 },
     1345        { "nick",           1, cmd_nick,           0 },
    13401346        { "no",             0, cmd_yesno,          0 },
    13411347        { "qlist",          0, cmd_qlist,          0 },
  • utils/README

    r8358691 rf5c0d8e  
    1818
    1919
    20 * create_nicksfile.pl (Christian Friedl <christian.friedl@chello.at>)
     20* convert_purple.py
    2121
    22 This program reads your ~/.licq/ configuration data and convert it to a
    23 correct .nicks file. This program can be extended to read other contact
    24 list file formats as well.
    25 
    26 
    27 * centericq2bitlbee.sh (geno <geno@xenyon.com>)
    28 
    29 Converter script for CenterICQ ICQ contact lists. See the documentation
    30 for more information.
    31 
    32 
    33 * convert_gnomeicu.txt
    34 
    35 Not a program, but this one contains a regex which should correctly
    36 convert GnomeICU configuration files into the BitlBee format.
    37 
    38 
    39 * Dynamic MOTD for BitlBee (Geert Hauwaerts <geert@hauwaerts.be>)
    40 
    41 Originally, I wanted to put this program here, but Geert put it online
    42 on his own server, with docs and stuff, so I guess it's better to put
    43 a link here. dmotd is a little script which generates a motd with some
    44 nice statistics, especially nice for servers with many people on it.
    45 
    46 See http://dmotd.hauwaerts.be/ for more information.
     22Converts libpurple configs into something BitlBee can use, so you don't
     23have to re-add all your accounts by hand.
    4724
    4825
Note: See TracChangeset for help on using the changeset viewer.