diff options
author | misdre <misdre@gmail.com> | 2013-04-06 01:11:28 +0200 |
---|---|---|
committer | misdre <misdre@gmail.com> | 2013-04-06 01:11:28 +0200 |
commit | 08d948435d29f2e78633299876c130c4b8702c2d (patch) | |
tree | bc856e8e7486801589f5cd2cddb7bad88f5ddeba /src | |
parent | 5004f69b5e68afa19c67d90207fa8e2d57332606 (diff) |
split cmd_msg too
Diffstat (limited to 'src')
-rw-r--r-- | src/common/outbound.c | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/src/common/outbound.c b/src/common/outbound.c index c167ec77..d6ce1488 100644 --- a/src/common/outbound.c +++ b/src/common/outbound.c @@ -2723,6 +2723,10 @@ cmd_msg (struct session *sess, char *tbuf, char *word[], char *word_eol[]) char *msg = word_eol[3]; struct session *newsess; + char *split_text = NULL; + int cmd_length = 13; /* " PRIVMSG ", " ", :, \r, \n */ + int offset = 0; + if (*nick) { if (*msg) @@ -2751,14 +2755,37 @@ cmd_msg (struct session *sess, char *tbuf, char *word[], char *word_eol[]) notc_msg (sess); return TRUE; } - sess->server->p_message (sess->server, nick, msg); + + while ((split_text = split_up_text (sess, msg + offset, cmd_length, split_text))) + { + sess->server->p_message (sess->server, nick, split_text); + + if (*split_text) + offset += strlen(split_text); + + g_free(split_text); + } + sess->server->p_message (sess->server, nick, msg + offset); + offset = 0; } newsess = find_dialog (sess->server, nick); if (!newsess) newsess = find_channel (sess->server, nick); if (newsess) + { + while ((split_text = split_up_text (sess, msg + offset, cmd_length, split_text))) + { + inbound_chanmsg (newsess->server, NULL, newsess->channel, + newsess->server->nick, split_text, TRUE, FALSE); + + if (*split_text) + offset += strlen(split_text); + + g_free(split_text); + } inbound_chanmsg (newsess->server, NULL, newsess->channel, - newsess->server->nick, msg, TRUE, FALSE); + newsess->server->nick, msg + offset, TRUE, FALSE); + } else { /* mask out passwords */ |