diff options
author | Wilmer van der Gaast <wilmer@gaast.net> | 2005-11-26 03:02:38 +0100 |
---|---|---|
committer | Wilmer van der Gaast <wilmer@gaast.net> | 2005-11-26 03:02:38 +0100 |
commit | 30f248a785685491a7e55c804e9221c04c8bdce4 (patch) | |
tree | 87b114a9d7e3d0ff830a0984db7797ae61963bfa /protocols/nogaim.c | |
parent | cb91b7267047beaf54e7a6c20cf71bf2c211e68f (diff) |
Lowered the line splitting limit a bit (and made it a bit prettier by trying to split on spaces, if possible). Should close #29.
Diffstat (limited to 'protocols/nogaim.c')
-rw-r--r-- | protocols/nogaim.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/protocols/nogaim.c b/protocols/nogaim.c index 41361e07..2a696992 100644 --- a/protocols/nogaim.c +++ b/protocols/nogaim.c @@ -644,31 +644,34 @@ void serv_got_im( struct gaim_connection *gc, char *handle, char *msg, guint32 f do_iconv( "UTF-8", set_getstr( irc, "charset" ), msg, buf, 0, 8192 ) != -1 ) msg = buf; - while( strlen( msg ) > 450 ) + while( strlen( msg ) > 425 ) { char tmp, *nl; - tmp = msg[450]; - msg[450] = 0; + tmp = msg[425]; + msg[425] = 0; - /* If there's a newline in this string, split up there so we're not - going to split up lines. If there isn't a newline, well, too bad. */ - if( ( nl = strrchr( msg, '\n' ) ) ) + /* If there's a newline/space in this string, split up there, + looks a bit prettier. */ + if( ( nl = strrchr( msg, '\n' ) ) || ( nl = strchr( msg, ' ' ) ) ) + { + msg[425] = tmp; + tmp = *nl; *nl = 0; + } irc_msgfrom( irc, u->nick, msg ); - msg[450] = tmp; - /* Move on. */ if( nl ) { - *nl = '\n'; + *nl = tmp; msg = nl + 1; } else { - msg += 450; + msg[425] = tmp; + msg += 425; } } irc_msgfrom( irc, u->nick, msg ); |