aboutsummaryrefslogtreecommitdiffstats
path: root/otr.c
diff options
context:
space:
mode:
authorunknown <pesco@khjk.org>2014-02-13 20:44:53 +0100
committerunknown <pesco@khjk.org>2014-02-13 20:44:53 +0100
commit820a2a79b97c96e63b984b17802e690ec16e3265 (patch)
treeb605bb89bd77ad52cf6d304a1b5cb3f45581991d /otr.c
parent74c9e7fb4393f160b45166b1c414a1e9996ca11b (diff)
fix 'otr connect' command
Diffstat (limited to 'otr.c')
-rw-r--r--otr.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/otr.c b/otr.c
index c0a890fa..318f9f13 100644
--- a/otr.c
+++ b/otr.c
@@ -967,6 +967,7 @@ void cmd_otr_disconnect(irc_t *irc, char **args)
void cmd_otr_connect(irc_t *irc, char **args)
{
irc_user_t *u;
+ char *msg, *query = "?OTR?";
u = irc_user_by_name(irc, args[1]);
if(!u || !u->bu || !u->bu->ic) {
@@ -980,7 +981,16 @@ void cmd_otr_connect(irc_t *irc, char **args)
/* passing this through the filter so it goes through libotr which
* will replace the simple query string with a proper one */
- otr_filter_msg_out(u, "?OTR?", 0);
+ msg = otr_filter_msg_out(u, query, 0);
+
+ /* send the message */
+ if(msg) {
+ u->bu->ic->acc->prpl->buddy_msg(u->bu->ic, u->bu->handle, msg, 0); /* XXX flags? */
+ /* XXX error message? */
+
+ if(msg != query)
+ g_free(msg);
+ }
}
void cmd_otr_smp(irc_t *irc, char **args)