From bc5a4f19d0805c443955f4df2459c5d247c918e4 Mon Sep 17 00:00:00 2001 From: Thomas Willingham Date: Sat, 29 Nov 2014 22:01:09 +0000 Subject: Fix abook_toggle_flag from postgres stuff --- include/Contact.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/Contact.php b/include/Contact.php index f0c7cd737..dedde3d1e 100644 --- a/include/Contact.php +++ b/include/Contact.php @@ -128,11 +128,13 @@ function vcard_from_xchan($xchan, $observer = null, $mode = '') { function abook_toggle_flag($abook,$flag) { - $r = q("UPDATE abook set abook_flags = (abook_flags & ~%d) where abook_id = %d and abook_channel = %d", - intval($flag), - intval($abook['abook_id']), - intval($abook['abook_channel']) - ); + $r = q("UPDATE abook set abook_flags = (abook_flags %s %d) where abook_id = %d and abook_channel = %d", + db_getfunc('^'), + intval($flag), + intval($abook['abook_id']), + intval($abook['abook_channel']) + ); + // if unsetting the archive bit, update the timestamps so we'll try to connect for an additional 30 days. -- cgit v1.2.3 From 5087d783b70a34f1db62a61d4a8b6e39edd444ed Mon Sep 17 00:00:00 2001 From: Thomas Willingham Date: Sat, 29 Nov 2014 22:06:04 +0000 Subject: =?UTF-8?q?Whitespace.=20=20Stupid=20=C2=A3#@=C2=A3@$=20editor.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/Contact.php | 10 +++++----- include/conversation.php | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'include') diff --git a/include/Contact.php b/include/Contact.php index dedde3d1e..64779d45f 100644 --- a/include/Contact.php +++ b/include/Contact.php @@ -129,11 +129,11 @@ function vcard_from_xchan($xchan, $observer = null, $mode = '') { function abook_toggle_flag($abook,$flag) { $r = q("UPDATE abook set abook_flags = (abook_flags %s %d) where abook_id = %d and abook_channel = %d", - db_getfunc('^'), - intval($flag), - intval($abook['abook_id']), - intval($abook['abook_channel']) - ); + db_getfunc('^'), + intval($flag), + intval($abook['abook_id']), + intval($abook['abook_channel']) + ); // if unsetting the archive bit, update the timestamps so we'll try to connect for an additional 30 days. diff --git a/include/conversation.php b/include/conversation.php index 425a655f7..6b3e278f0 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -915,8 +915,8 @@ function item_photo_menu($item){ if($contact) { $poke_link = $a->get_baseurl($ssl_state) . '/poke/?f=&c=' . $contact['abook_id']; - if (!($contact['abook_flags'] & ABOOK_FLAG_SELF)) - $contact_url = $a->get_baseurl($ssl_state) . '/connedit/' . $contact['abook_id']; + if (!($contact['abook_flags'] & ABOOK_FLAG_SELF)) + $contact_url = $a->get_baseurl($ssl_state) . '/connedit/' . $contact['abook_id']; $posts_link = $a->get_baseurl($ssl_state) . '/network/?cid=' . $contact['abook_id']; $clean_url = normalise_link($item['author-link']); -- cgit v1.2.3 From def10df816ec7ca25fe463bf029e84ba7dfdba61 Mon Sep 17 00:00:00 2001 From: Thomas Willingham Date: Mon, 1 Dec 2014 19:09:50 +0000 Subject: Somewhat subtle process_delivery() bug - $public was not being reset if a sys channel is reached but then the loop iterated over another channel. --- include/zot.php | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/zot.php b/include/zot.php index 3b8584509..a7c6e32ac 100644 --- a/include/zot.php +++ b/include/zot.php @@ -1419,6 +1419,7 @@ function process_delivery($sender,$arr,$deliveries,$relay,$public = false,$reque } foreach($deliveries as $d) { + $public = false; $r = q("select * from channel where channel_hash = '%s' limit 1", dbesc($d['hash']) ); -- cgit v1.2.3