diff options
author | Sven Moritz Hallberg <pesco@khjk.org> | 2010-09-19 22:04:32 +0200 |
---|---|---|
committer | Sven Moritz Hallberg <pesco@khjk.org> | 2010-09-19 22:04:32 +0200 |
commit | 0e078a7bfc86516ea3d3927c4ca327d572626089 (patch) | |
tree | 330e3a7218156c3c2c73462cd18495732f8a51c9 | |
parent | 10d89be0b7a035e2fc993bf9ff63d78c8a93f90f (diff) |
complain when trying smp without an otr channel
-rw-r--r-- | otr.c | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -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; } |