improved some comments

Signed-off-by: Roland Häder <roland@mxchange.org>
This commit is contained in:
Roland Häder 2017-05-17 15:28:01 +02:00
parent 635b26353c
commit 031d96d933
No known key found for this signature in database
GPG Key ID: B72F8185C6C7BD78

View File

@ -880,11 +880,14 @@ class Diaspora {
if (dbm::is_result($r)) { if (dbm::is_result($r)) {
return $r[0]; return $r[0];
} else { } else {
// We haven't found it? /*
// We use another function for it that will possibly create a contact entry * Not found yet? Then use another function for it that will
* possibly create a contact entry.
*/
$cid = get_contact($handle, $uid); $cid = get_contact($handle, $uid);
if ($cid > 0) { if ($cid > 0) {
/// @TODO Contact-retrival should be encapsulated into an "entity" class like `Contact`
$r = q("SELECT * FROM `contact` WHERE `id` = %d LIMIT 1", intval($cid)); $r = q("SELECT * FROM `contact` WHERE `id` = %d LIMIT 1", intval($cid));
if (dbm::is_result($r)) { if (dbm::is_result($r)) {
@ -919,9 +922,11 @@ class Diaspora {
*/ */
private static function post_allow($importer, $contact, $is_comment = false) { private static function post_allow($importer, $contact, $is_comment = false) {
// perhaps we were already sharing with this person. Now they're sharing with us. /*
// That makes us friends. * perhaps we were already sharing with this person. Now they're sharing with us.
// Normally this should have handled by getting a request - but this could get lost * That makes us friends.
* Normally this should have handled by getting a request - but this could get lost
*/
if ($contact["rel"] == CONTACT_IS_FOLLOWER && in_array($importer["page-flags"], array(PAGE_FREELOVE))) { if ($contact["rel"] == CONTACT_IS_FOLLOWER && in_array($importer["page-flags"], array(PAGE_FREELOVE))) {
q("UPDATE `contact` SET `rel` = %d, `writable` = 1 WHERE `id` = %d AND `uid` = %d", q("UPDATE `contact` SET `rel` = %d, `writable` = 1 WHERE `id` = %d AND `uid` = %d",
intval(CONTACT_IS_FRIEND), intval(CONTACT_IS_FRIEND),
@ -944,6 +949,7 @@ class Diaspora {
} elseif (($contact["rel"] == CONTACT_IS_FOLLOWER) && ($importer["page-flags"] == PAGE_COMMUNITY)) { } elseif (($contact["rel"] == CONTACT_IS_FOLLOWER) && ($importer["page-flags"] == PAGE_COMMUNITY)) {
// That's good // That's good
return true; return true;
// Is the message a comment for global users?
} elseif (($importer["uid"] == 0) || $is_comment) { } elseif (($importer["uid"] == 0) || $is_comment) {
// Messages for the global users and comments are always accepted // Messages for the global users and comments are always accepted
return true; return true;