From 94e7eb3aaefc753ea81ea8c9e38570407d4c9790 Mon Sep 17 00:00:00 2001 From: Sven Moritz Hallberg Date: Sun, 10 Feb 2008 18:56:59 +0100 Subject: add 'otr keygen' command --- query.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'query.c') diff --git a/query.c b/query.c index 99be2bee..3ae1ce31 100644 --- a/query.c +++ b/query.c @@ -139,12 +139,18 @@ void query_answer( irc_t *irc, query_t *q, int ans ) } if( ans ) { - imcb_log( q->ic, "Accepted: %s", q->question ); + if(q->ic) + imcb_log( q->ic, "Accepted: %s", q->question ); + else + irc_usermsg( irc, "Accepted: %s", q->question ); q->yes( NULL, q->data ); } else { - imcb_log( q->ic, "Rejected: %s", q->question ); + if(q->ic) + imcb_log( q->ic, "Rejected: %s", q->question ); + else + irc_usermsg( irc, "Rejected: %s", q->question ); q->no( NULL, q->data ); } q->data = NULL; -- cgit v1.2.3 From e6cb1101cbbf6a4c2751f20c2072c9ca3127ad98 Mon Sep 17 00:00:00 2001 From: Sven Moritz Hallberg Date: Mon, 11 Feb 2008 21:31:27 +0100 Subject: allow NULL for yes/no handlers --- query.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'query.c') diff --git a/query.c b/query.c index 3ae1ce31..99a579bc 100644 --- a/query.c +++ b/query.c @@ -143,7 +143,8 @@ void query_answer( irc_t *irc, query_t *q, int ans ) imcb_log( q->ic, "Accepted: %s", q->question ); else irc_usermsg( irc, "Accepted: %s", q->question ); - q->yes( NULL, q->data ); + if(q->yes) + q->yes( NULL, q->data ); } else { @@ -151,7 +152,8 @@ void query_answer( irc_t *irc, query_t *q, int ans ) imcb_log( q->ic, "Rejected: %s", q->question ); else irc_usermsg( irc, "Rejected: %s", q->question ); - q->no( NULL, q->data ); + if(q->no) + q->no( NULL, q->data ); } q->data = NULL; -- cgit v1.2.3 From d6fdf44c54ac2aecfd0c94a2d56be04e44a51eb3 Mon Sep 17 00:00:00 2001 From: Sven Moritz Hallberg Date: Mon, 11 Feb 2008 21:58:33 +0100 Subject: pass the im_connection as first argument to yes/no handlers --- query.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'query.c') diff --git a/query.c b/query.c index 99a579bc..49865c86 100644 --- a/query.c +++ b/query.c @@ -144,7 +144,7 @@ void query_answer( irc_t *irc, query_t *q, int ans ) else irc_usermsg( irc, "Accepted: %s", q->question ); if(q->yes) - q->yes( NULL, q->data ); + q->yes( q->ic, q->data ); } else { @@ -153,7 +153,7 @@ void query_answer( irc_t *irc, query_t *q, int ans ) else irc_usermsg( irc, "Rejected: %s", q->question ); if(q->no) - q->no( NULL, q->data ); + q->no( q->ic, q->data ); } q->data = NULL; -- cgit v1.2.3 From 8bd697c80fe304b9a63f9e87d4d4a4e3b1a6bebd Mon Sep 17 00:00:00 2001 From: Sven Moritz Hallberg Date: Mon, 11 Feb 2008 22:53:10 +0100 Subject: query_add: allow NULL for ic and pass irc to handler in that case --- query.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'query.c') diff --git a/query.c b/query.c index 49865c86..7cfad745 100644 --- a/query.c +++ b/query.c @@ -101,6 +101,9 @@ void query_del_by_conn( irc_t *irc, struct im_connection *ic ) query_t *q, *n, *def; int count = 0; + if(!ic) + return; + q = irc->queries; def = query_default( irc ); @@ -144,7 +147,7 @@ void query_answer( irc_t *irc, query_t *q, int ans ) else irc_usermsg( irc, "Accepted: %s", q->question ); if(q->yes) - q->yes( q->ic, q->data ); + q->yes( q->ic ? q->ic : irc, q->data ); } else { @@ -153,7 +156,7 @@ void query_answer( irc_t *irc, query_t *q, int ans ) else irc_usermsg( irc, "Rejected: %s", q->question ); if(q->no) - q->no( q->ic, q->data ); + q->no( q->ic ? q->ic : irc, q->data ); } q->data = NULL; -- cgit v1.2.3 From 5f4eedefd2a444c213f65283a3d942d6287e6ea2 Mon Sep 17 00:00:00 2001 From: Sven Moritz Hallberg Date: Tue, 12 Feb 2008 00:16:23 +0100 Subject: - add nonfunctional 'otr forget key' implementation - add 'color_encrypted' setting --- query.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'query.c') diff --git a/query.c b/query.c index 7cfad745..d167abe8 100644 --- a/query.c +++ b/query.c @@ -147,7 +147,7 @@ void query_answer( irc_t *irc, query_t *q, int ans ) else irc_usermsg( irc, "Accepted: %s", q->question ); if(q->yes) - q->yes( q->ic ? q->ic : irc, q->data ); + q->yes( q->ic ? (gpointer)q->ic : (gpointer)irc, q->data ); } else { @@ -156,7 +156,7 @@ void query_answer( irc_t *irc, query_t *q, int ans ) else irc_usermsg( irc, "Rejected: %s", q->question ); if(q->no) - q->no( q->ic ? q->ic : irc, q->data ); + q->no( q->ic ? (gpointer)q->ic : (gpointer)irc, q->data ); } q->data = NULL; -- cgit v1.2.3