aboutsummaryrefslogtreecommitdiffstats
path: root/otr.c
diff options
context:
space:
mode:
authorSven Moritz Hallberg <pesco@khjk.org>2010-09-19 22:04:32 +0200
committerSven Moritz Hallberg <pesco@khjk.org>2010-09-19 22:04:32 +0200
commit0e078a7bfc86516ea3d3927c4ca327d572626089 (patch)
tree330e3a7218156c3c2c73462cd18495732f8a51c9 /otr.c
parent10d89be0b7a035e2fc993bf9ff63d78c8a93f90f (diff)
complain when trying smp without an otr channel
Diffstat (limited to 'otr.c')
-rw-r--r--otr.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/otr.c b/otr.c
index 72706c42..380dd349 100644
--- a/otr.c
+++ b/otr.c
@@ -1063,6 +1063,9 @@ void otr_handle_smp(struct im_connection *ic, const char *handle, OtrlTLV *tlvs)
ic->acc->user, ic->acc->prpl->name, 1, NULL, NULL, NULL);
if(!context) {
/* huh? out of memory or what? */
+ irc_usermsg(irc, "smp: failed to get otr context for %s", u->nick);
+ otrl_message_abort_smp(us, ops, u->bu->ic, context);
+ otrl_sm_state_free(context->smstate);
return;
}
nextMsg = context->smstate->nextExpected;
@@ -1173,9 +1176,10 @@ void otr_initiate_smp(irc_t *irc, const char *nick, const char *question,
}
ctx = otrl_context_find(irc->otr->us, u->bu->handle,
- u->bu->ic->acc->user, u->bu->ic->acc->prpl->name, 1, NULL, NULL, NULL);
- if(!ctx) {
- /* huh? out of memory or what? */
+ u->bu->ic->acc->user, u->bu->ic->acc->prpl->name, 0, NULL, NULL, NULL);
+ if(!ctx || ctx->msgstate != OTRL_MSGSTATE_ENCRYPTED) {
+ irc_usermsg(irc, "smp: otr inactive with %s, try \x02otr connect"
+ " %s\x02", nick, nick);
return;
}