Changeset b20b32f for protocols/nogaim.c


Ignore:
Timestamp:
2005-11-28T01:14:06Z (18 years ago)
Author:
Jelmer Vernooij <jelmer@…>
Branches:
master
Children:
65e2ce1, cfcc587
Parents:
2cdd8ce (diff), dfde8e0 (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 from Wilmer

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/nogaim.c

    r2cdd8ce rb20b32f  
    295295{
    296296        va_list params;
    297         char text[1024], buf[1024];
     297        char text[1024], buf[1024], acc_id[33];
    298298        char *msg;
     299        account_t *a;
    299300       
    300301        va_start( params, format );
     
    312313                strip_html( msg );
    313314       
    314         irc_usermsg( gc->irc, "%s(%s) - %s", gc->prpl->name, gc->username, msg );
     315        /* Try to find a different connection on the same protocol. */
     316        for( a = gc->irc->accounts; a; a = a->next )
     317                if( a->prpl == gc->prpl && a->gc != gc )
     318                        break;
     319       
     320        /* If we found one, add the screenname to the acc_id. */
     321        if( a )
     322                g_snprintf( acc_id, 32, "%s(%s)", gc->prpl->name, gc->username );
     323        else
     324                g_snprintf( acc_id, 32, "%s", gc->prpl->name );
     325       
     326        irc_usermsg( gc->irc, "%s - %s", acc_id, msg );
    315327}
    316328
     
    706718                msg = buf;
    707719       
    708         while( strlen( msg ) > 450 )
     720        while( strlen( msg ) > 425 )
    709721        {
    710722                char tmp, *nl;
    711723               
    712                 tmp = msg[450];
    713                 msg[450] = 0;
    714                
    715                 /* If there's a newline in this string, split up there so we're not
    716                    going to split up lines. If there isn't a newline, well, too bad. */
    717                 if( ( nl = strrchr( msg, '\n' ) ) )
     724                tmp = msg[425];
     725                msg[425] = 0;
     726               
     727                /* If there's a newline/space in this string, split up there,
     728                   looks a bit prettier. */
     729                if( ( nl = strrchr( msg, '\n' ) ) || ( nl = strchr( msg, ' ' ) ) )
     730                {
     731                        msg[425] = tmp;
     732                        tmp = *nl;
    718733                        *nl = 0;
     734                }
    719735               
    720736                irc_msgfrom( irc, u->nick, msg );
    721                
    722                 msg[450] = tmp;
    723737               
    724738                /* Move on. */
    725739                if( nl )
    726740                {
    727                         *nl = '\n';
     741                        *nl = tmp;
    728742                        msg = nl + 1;
    729743                }
    730744                else
    731745                {
    732                         msg += 450;
     746                        msg[425] = tmp;
     747                        msg += 425;
    733748                }
    734749        }
     
    744759       
    745760        if( ( u = user_findhandle( gc, handle ) ) )
    746                 irc_noticefrom( gc->irc, u->nick, "* Typing a message *" );
     761                irc_msgfrom( gc->irc, u->nick, "\1TYPING 1\1" );
    747762}
    748763
Note: See TracChangeset for help on using the changeset viewer.