From 01eee14abb52cf2140ea355315851c03bf396014 Mon Sep 17 00:00:00 2001 From: Marius Halden Date: Thu, 18 Feb 2016 23:42:05 +0100 Subject: Mark as read on reply, mark as read only when available The set `mark_read` now accepts `available` in addition to `true` and `false`. When `mark_read` is set to `available` it will only mark messages read when the user is not marked as away/invisible. The set `mark_read_reply` was added, when this is set to `true` any unread messages will be marked as read when the user replies them (assuming they where received by bitlbee). --- facebook/facebook-util.h | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'facebook/facebook-util.h') diff --git a/facebook/facebook-util.h b/facebook/facebook-util.h index 71dc3ec..75735e4 100644 --- a/facebook/facebook-util.h +++ b/facebook/facebook-util.h @@ -36,6 +36,35 @@ */ #define FB_UTIL_ERROR fb_util_error_quark() +/** + * FB_UTIL_PTRBIT_GET: + * @p: Pointer used to store flags. + * @b: Bit to get from p. + * + * Get bit b from pointer p. + * + * Returns: Value of bit b in pointer p. + */ +#define FB_UTIL_PTRBIT_GET(p, b) \ + (GPOINTER_TO_INT((p)) & (1 << (b))) + +/** + * FB_UTIL_PTRBIT_SET: + * @p: Pointer used to store flags. + * @b: Bit to set in p. + * @v: Set or clear bit b + * + * Set bit b in pointer p based on value v + */ +#define FB_UTIL_PTRBIT_SET(p, b, v) \ + G_STMT_START { \ + gint __tmp; \ + __tmp = GPOINTER_TO_INT((p)); \ + __tmp &= ~(1 << (b)); \ + __tmp |= ((v) << (b)); \ + (p) = GINT_TO_POINTER(__tmp); \ + } G_STMT_END + /** * FbDebugLevel: * @FB_UTIL_DEBUG_LEVEL_MISC: Miscellaneous message. -- cgit v1.2.3