diff options
| author | Sven Moritz Hallberg <pesco@khjk.org> | 2010-06-03 23:47:53 +0200 | 
|---|---|---|
| committer | Sven Moritz Hallberg <pesco@khjk.org> | 2010-06-03 23:47:53 +0200 | 
| commit | 1dd34701541fb8142402f593dc256ff9b54121bb (patch) | |
| tree | 5a39c50aa8ba49246befa9cd22d9f9b9cf654c58 /otr.c | |
| parent | bb09b3c6b8190be09e0b7c7ef2f4b1b5a69b504f (diff) | |
add an option to disable otr on twitter (and other unsuitable protocols)
Diffstat (limited to 'otr.c')
| -rw-r--r-- | otr.c | 15 | 
1 files changed, 15 insertions, 0 deletions
| @@ -303,6 +303,11 @@ int otr_check_for_key(account_t *a)  	irc_t *irc = a->irc;  	OtrlPrivKey *k; +	/* don't do OTR on certain (not classic IM) protocols, e.g. twitter */ +	if(a->prpl->options & OPT_NOOTR) { +		return 0; +	} +	  	k = otrl_privkey_find(irc->otr->us, a->user, a->prpl->name);  	if(k) {  		irc_usermsg(irc, "otr: %s/%s ready", a->user, a->prpl->name); @@ -324,6 +329,11 @@ char *otr_handle_message(struct im_connection *ic, const char *handle, const cha  	OtrlTLV *tlvs = NULL;  	char *colormsg; +	/* don't do OTR on certain (not classic IM) protocols, e.g. twitter */ +	if(ic->acc->prpl->options & OPT_NOOTR) { +		return (g_strdup(msg)); +	} +	  	ignore_msg = otrl_message_receiving(ic->irc->otr->us, &global.otr_ops, ic,  		ic->acc->user, ic->acc->prpl->name, handle, msg, &newmsg,  		&tlvs, NULL, NULL); @@ -370,6 +380,11 @@ int otr_send_message(struct im_connection *ic, const char *handle, const char *m  	int st;  	char *otrmsg = NULL;  	ConnContext *ctx = NULL; + +	/* don't do OTR on certain (not classic IM) protocols, e.g. twitter */ +	if(ic->acc->prpl->options & OPT_NOOTR) { +		return (ic->acc->prpl->buddy_msg(ic, handle, msg, flags)); +	}  	st = otrl_message_sending(ic->irc->otr->us, &global.otr_ops, ic,  		ic->acc->user, ic->acc->prpl->name, handle, | 
