Changeset ea728e6


Ignore:
Timestamp:
2010-08-24T12:19:52Z (9 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
b78c4b9
Parents:
9b1d2d6 (diff), bd599b9 (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:

Merging mainline.

Files:
1 added
3 deleted
10 edited

Legend:

Unmodified
Added
Removed
  • irc.h

    r9b1d2d6 rea728e6  
    282282void irc_send_channel_user_mode_diff( irc_channel_t *ic, irc_user_t *iu,
    283283                                      irc_channel_user_flags_t old, irc_channel_user_flags_t new );
     284void irc_send_invite( irc_user_t *iu, irc_channel_t *ic );
    284285
    285286/* irc_user.c */
  • irc_im.c

    r9b1d2d6 rea728e6  
    613613}
    614614
     615static gboolean bee_irc_chat_invite( bee_t *bee, bee_user_t *bu, const char *name, const char *msg )
     616{
     617        char *channel, *s;
     618        irc_t *irc = bee->ui_data;
     619        irc_user_t *iu = bu->ui_data;
     620        irc_channel_t *chan;
     621       
     622        if( strchr( CTYPES, name[0] ) )
     623                channel = g_strdup( name );
     624        else
     625                channel = g_strdup_printf( "#%s", name );
     626       
     627        if( ( s = strchr( channel, '@' ) ) )
     628                *s = '\0';
     629       
     630        if( strlen( channel ) > MAX_NICK_LENGTH )
     631        {
     632                /* If the channel name is very long (like those insane GTalk
     633                   UUID names), try if we can use the inviter's nick. */
     634                s = g_strdup_printf( "#%s", iu->nick );
     635                if( irc_channel_by_name( irc, s ) == NULL )
     636                {
     637                        g_free( channel );
     638                        channel = s;
     639                }
     640        }
     641       
     642        if( ( chan = irc_channel_new( irc, channel ) ) &&
     643            set_setstr( &chan->set, "type", "chat" ) &&
     644            set_setstr( &chan->set, "chat_type", "room" ) &&
     645            set_setstr( &chan->set, "account", bu->ic->acc->tag ) &&
     646            set_setstr( &chan->set, "room", (char*) name ) )
     647        {
     648                /* I'm assuming that if the user didn't "chat add" the room
     649                   himself but got invited, it's temporary, so make this a
     650                   temporary mapping that is removed as soon as we /PART. */
     651                chan->flags |= IRC_CHANNEL_TEMP;
     652        }
     653        else
     654        {
     655                irc_channel_free( chan );
     656                chan = NULL;
     657        }
     658        g_free( channel );
     659       
     660        irc_send_msg_f( iu, "PRIVMSG", irc->user->nick, "<< \002BitlBee\002 - Invitation to chatroom %s >>", name );
     661        if( msg )
     662                irc_send_msg( iu, "PRIVMSG", irc->user->nick, msg, NULL );
     663        if( chan )
     664        {
     665                irc_send_msg_f( iu, "PRIVMSG", irc->user->nick, "To join the room, just /join %s", chan->name );
     666                irc_send_invite( iu, chan );
     667        }
     668       
     669        return TRUE;
     670}
     671
    615672/* IRC->IM */
    616673static gboolean bee_irc_channel_chat_privmsg_cb( gpointer data, gint fd, b_input_condition cond );
     
    909966        bee_irc_chat_topic,
    910967        bee_irc_chat_name_hint,
     968        bee_irc_chat_invite,
    911969       
    912970        bee_irc_ft_in_start,
  • irc_send.c

    r9b1d2d6 rea728e6  
    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}
  • protocols/bee.h

    r9b1d2d6 rea728e6  
    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 );
     
    176177G_MODULE_EXPORT int bee_chat_msg( bee_t *bee, struct groupchat *c, const char *msg, int flags );
    177178G_MODULE_EXPORT struct groupchat *bee_chat_by_title( bee_t *bee, struct im_connection *ic, const char *title );
     179G_MODULE_EXPORT void imcb_chat_invite( struct im_connection *ic, const char *name, const char *who, const char *msg );
    178180
    179181#endif /* __BEE_H__ */
  • protocols/bee_chat.c

    r9b1d2d6 rea728e6  
    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/message.c

    r9b1d2d6 rea728e6  
    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                }
     
    104104                        imcb_buddy_msg( ic, from, fullmsg->str,
    105105                                        0, jabber_get_timestamp( node ) );
     106                if( room )
     107                        imcb_chat_invite( ic, room, from, reason );
    106108               
    107109                g_string_free( fullmsg, TRUE );
  • protocols/jabber/si.c

    r9b1d2d6 rea728e6  
    262262                                break;
    263263                        }
     264                        else
     265                        {
     266                                c = c->next;
     267                        }
    264268
    265269                if ( !requestok )
     
    373377{
    374378        struct xt_node *c, *d;
    375         char *ini_jid, *tgt_jid, *iq_id, *cmp;
     379        char *ini_jid = NULL, *tgt_jid, *iq_id, *cmp;
    376380        GSList *tflist;
    377381        struct jabber_transfer *tf=NULL;
  • protocols/twitter/twitter_lib.c

    r9b1d2d6 rea728e6  
    373373static xt_status twitter_xt_get_status( struct xt_node *node, struct twitter_xml_status *txs )
    374374{
    375         struct xt_node *child, *rt;
     375        struct xt_node *child, *rt = NULL;
    376376        gboolean truncated = FALSE;
    377377
  • protocols/yahoo/libyahoo2.c

    r9b1d2d6 rea728e6  
    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}
  • utils/README

    r9b1d2d6 rea728e6  
    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.