aboutsummaryrefslogtreecommitdiffstats
path: root/facebook/facebook-util.h
diff options
context:
space:
mode:
authorMarius Halden <marius.h@lden.org>2016-02-18 23:42:05 +0100
committerMarius Halden <marius.h@lden.org>2016-03-11 23:24:55 +0100
commit01eee14abb52cf2140ea355315851c03bf396014 (patch)
tree8279d3885fc77c0bf1e4765835e1628de56bd737 /facebook/facebook-util.h
parent205d2edcfc2494dbff4bba1dde368b77a961eb86 (diff)
downloadbitlbee-facebook-01eee14abb52cf2140ea355315851c03bf396014.tar.gz
bitlbee-facebook-01eee14abb52cf2140ea355315851c03bf396014.tar.bz2
bitlbee-facebook-01eee14abb52cf2140ea355315851c03bf396014.tar.xz
Mark as read on reply, mark as read only when availablemark-on-reply
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).
Diffstat (limited to 'facebook/facebook-util.h')
-rw-r--r--facebook/facebook-util.h29
1 files changed, 29 insertions, 0 deletions
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
@@ -37,6 +37,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.
* @FB_UTIL_DEBUG_LEVEL_INFO: Information message.