/pidgin/main: 15514969ff61: Request API: fix a bug when checking...
Tomasz Wasilczyk
twasilczyk at pidgin.im
Tue Nov 5 07:41:01 EST 2013
Changeset: 15514969ff61c16081e36520e2dd0748cf8289fb
Author: Tomasz Wasilczyk <twasilczyk at pidgin.im>
Date: 2013-11-05 13:39 +0100
Branch: default
URL: https://hg.pidgin.im/pidgin/main/rev/15514969ff61
Description:
Request API: fix a bug when checking datasheet action sensitivity
diffstat:
libpurple/request-datasheet.c | 14 +++++++++++---
1 files changed, 11 insertions(+), 3 deletions(-)
diffs (31 lines):
diff --git a/libpurple/request-datasheet.c b/libpurple/request-datasheet.c
--- a/libpurple/request-datasheet.c
+++ b/libpurple/request-datasheet.c
@@ -244,8 +244,16 @@ purple_request_datasheet_action_call(Pur
{
g_return_if_fail(act != NULL);
- if (act->cb)
- act->cb(rec, act->cb_data);
+ if (!act->cb)
+ return;
+
+ if (!purple_request_datasheet_action_is_sensitive(act, rec) {
+ purple_debug_warning("request-datasheet",
+ "Action is disabled for this record");
+ return;
+ }
+
+ act->cb(rec, act->cb_data);
}
void
@@ -268,7 +276,7 @@ purple_request_datasheet_action_is_sensi
if (!act->sens_cb)
return (rec != NULL);
- return act->sens_cb(rec, act->cb_data);
+ return act->sens_cb(rec, act->sens_data);
}
/***** Datasheet record API ***************************************************/
More information about the Commits
mailing list