Mercurial > pidgin
changeset 31705:a99a4f9b7171
merge of '2cabccedebb0366f69f7d3e9c3e16e2f4c6b3aae'
and '964dd46e688370c356b8c9f20a929290f4a00e6d'
author | Paul Aurich <paul@darkrain42.org> |
---|---|
date | Sat, 25 Jun 2011 02:47:48 +0000 |
parents | 54a700cedb38 (diff) 4f1bd59cb90a (current diff) |
children | 910e966d18b3 |
files | |
diffstat | 2 files changed, 12 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/libpurple/protocols/irc/irc.c Sat Jun 25 02:34:24 2011 +0000 +++ b/libpurple/protocols/irc/irc.c Sat Jun 25 02:47:48 2011 +0000 @@ -101,7 +101,11 @@ static int irc_send_raw(PurpleConnection *gc, const char *buf, int len) { struct irc_conn *irc = (struct irc_conn*)gc->proto_data; - return do_send(irc, buf, len); + if (len == -1) { + len = strlen(buf); + } + irc_send_len(irc, buf, len); + return len; } static void @@ -144,16 +148,18 @@ int irc_send(struct irc_conn *irc, const char *buf) { - int ret, buflen; + return irc_send_len(irc, buf, strlen(buf)); +} + +int irc_send_len(struct irc_conn *irc, const char *buf, int buflen) +{ + int ret; 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; - buflen = strlen(tosend); - - /* If we're not buffering writes, try to send immediately */ if (!irc->writeh) ret = do_send(irc, tosend, buflen);
--- a/libpurple/protocols/irc/irc.h Sat Jun 25 02:34:24 2011 +0000 +++ b/libpurple/protocols/irc/irc.h Sat Jun 25 02:47:48 2011 +0000 @@ -106,6 +106,7 @@ typedef int (*IRCCmdCallback) (struct irc_conn *irc, const char *cmd, const char *target, const char **args); int irc_send(struct irc_conn *irc, const char *buf); +int irc_send_len(struct irc_conn *irc, const char *buf, int len); gboolean irc_blist_timeout(struct irc_conn *irc); gboolean irc_who_channel_timeout(struct irc_conn *irc); void irc_buddy_query(struct irc_conn *irc);