summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordx <dx@dxzone.com.ar>2017-04-06 03:26:50 -0300
committerdx <dx@dxzone.com.ar>2017-04-06 03:26:50 -0300
commitdfeb74ebaa0477dad42dc760f0f0c8c3af73c2cf (patch)
tree6a58ae68774be6d4664a30911ebf688718682820
parent303d892d6f0a89144fc6e2c9622acb14dc777930 (diff)
downloadpidgin-dfeb74ebaa0477dad42dc760f0f0c8c3af73c2cf.tar.gz
irc: update buflen if irc-sending-text changed the text to send
Fixes issues with the irc more plugin, which extended the part and quit messages but their lengths weren't updated, which resulted in those parts/quits getting sent to the server without ending newlines.
-rw-r--r--libpurple/protocols/irc/irc.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libpurple/protocols/irc/irc.c b/libpurple/protocols/irc/irc.c
index f101cbe6af..633dbb8475 100644
--- a/libpurple/protocols/irc/irc.c
+++ b/libpurple/protocols/irc/irc.c
@@ -154,13 +154,17 @@ int irc_send(struct irc_conn *irc, const char *buf)
int irc_send_len(struct irc_conn *irc, const char *buf, int buflen)
{
int ret;
- char *tosend= g_strdup(buf);
+ char *tosend = g_strdup(buf);
purple_signal_emit(_irc_plugin, "irc-sending-text", purple_account_get_connection(irc->account), &tosend);
if (tosend == NULL)
return 0;
+ if (!purple_strequal(tosend, buf)) {
+ buflen = strlen(tosend);
+ }
+
/* If we're not buffering writes, try to send immediately */
if (!irc->writeh)
ret = do_send(irc, tosend, buflen);