aboutsummaryrefslogtreecommitdiffstats
path: root/include/identity.php
diff options
context:
space:
mode:
authorPaolo T <tuscanhobbit@users.noreply.github.com>2014-10-12 09:15:39 +0200
committerPaolo T <tuscanhobbit@users.noreply.github.com>2014-10-12 09:15:39 +0200
commit56f6f696bd5dd5b8120d562d9f43fe94d8e6dd41 (patch)
treec1376be525c85ab799f213ed79648d8c478da3d0 /include/identity.php
parent9edaa2843b9982f52fb1ed93b1c6e3d9e53921d7 (diff)
parent44c4c9c5c271a5ad163a089b1dc271d108a59700 (diff)
downloadvolse-hubzilla-56f6f696bd5dd5b8120d562d9f43fe94d8e6dd41.tar.gz
volse-hubzilla-56f6f696bd5dd5b8120d562d9f43fe94d8e6dd41.tar.bz2
volse-hubzilla-56f6f696bd5dd5b8120d562d9f43fe94d8e6dd41.zip
Merge pull request #6 from tuscanhobbit/master
Fast forward local hub
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