aboutsummaryrefslogtreecommitdiffstats
path: root/include/identity.php
diff options
context:
space:
mode:
authorhabeascodice <habeascodice@federated.social>2014-10-09 01:06:59 -0700
committerhabeascodice <habeascodice@federated.social>2014-10-09 01:06:59 -0700
commit7a106cf60cfa005ec6d8c35f922dc57b9af0175e (patch)
tree34b0593f9922f33d9e2c2c517ba9f6e9d3490c44 /include/identity.php
parent737a3362d50900a5f26aada14f515c5c857a762f (diff)
parentfc0576acf810019a0c168bfa4dc4a2175ae0b505 (diff)
downloadvolse-hubzilla-7a106cf60cfa005ec6d8c35f922dc57b9af0175e.tar.gz
volse-hubzilla-7a106cf60cfa005ec6d8c35f922dc57b9af0175e.tar.bz2
volse-hubzilla-7a106cf60cfa005ec6d8c35f922dc57b9af0175e.zip
Merge remote branch 'upstream/master'
Diffstat (limited to 'include/identity.php')
-rw-r--r--include/identity.php32
1 files changed, 32 insertions, 0 deletions
diff --git a/include/identity.php b/include/identity.php
index fafb97bbb..4417f4028 100644
--- a/include/identity.php
+++ b/include/identity.php
@@ -1525,4 +1525,36 @@ function get_profile_fields_advanced($filter = 0) {
return $x;
}
+/**
+ * @function notifications_off($channel_id)
+ * Clear notifyflags for a channel - most likely during bulk import of content or other activity that is likely
+ * to generate huge amounts of undesired notifications.
+ * @param int $channel_id
+ * The channel to disable notifications for
+ * @returns int
+ * Current notification flag value. Send this to notifications_on() to restore the channel settings when finished
+ * with the activity requiring notifications_off();
+ */
+
+
+function notifications_off($channel_id) {
+ $r = q("select channel_notifyflags from channel where channel_id = %d limit 1",
+ intval($channel_id)
+ );
+ $x = q("update channel set channel_notifyflags = 0 where channel_id = %d limit 1",
+ intval($channel_id)
+ );
+
+ return intval($r[0]['channel_notifyflags']);
+
+}
+
+
+function notifications_on($channel_id,$value) {
+ $x = q("update channel set channel_notifyflags = %d where channel_id = %d limit 1",
+ intval($value),
+ intval($channel_id)
+ );
+ return $x;
+} \ No newline at end of file