*
* @param array $arr Contains the just posted item record
*/
- private static function updateContact($arr) {
+ private static function updateContact($arr)
+ {
// Unarchive the author
$contact = dba::selectFirst('contact', [], ['id' => $arr["author-link"]]);
if ($contact['term-date'] > NULL_DATE) {
}
}
- private static function setHashtags(&$item) {
+ private static function setHashtags(&$item)
+ {
$tags = get_tags($item["body"]);
$item["body"] = str_replace("#", "#", $item["body"]);
}
- public static function getGuidById($id) {
+ public static function getGuidById($id)
+ {
$r = q("SELECT `guid` FROM `item` WHERE `id` = %d LIMIT 1", intval($id));
if (DBM::is_result($r)) {
return $r[0]["guid"];
}
}
- public static function getIdAndNickByGuid($guid, $uid = 0) {
-
+ public static function getIdAndNickByGuid($guid, $uid = 0)
+ {
$nick = "";
$id = 0;
}
- public static function isRemoteSelf($contact, &$datarray) {
+ public static function isRemoteSelf($contact, &$datarray)
+ {
$a = get_app();
if (!$contact['remote_self']) {
return $new_body;
}
- private static function hasPermissions($obj) {
+ private static function hasPermissions($obj)
+ {
return (
(
x($obj, 'allow_cid')
);
}
- private static function samePermissions($obj1, $obj2) {
+ private static function samePermissions($obj1, $obj2)
+ {
// first part is easy. Check that these are exactly the same.
if (($obj1['allow_cid'] == $obj2['allow_cid'])
&& ($obj1['allow_gid'] == $obj2['allow_gid'])
}
// returns an array of contact-ids that are allowed to see this object
- private static function enumeratePermissions($obj) {
+ private static function enumeratePermissions($obj)
+ {
$allow_people = expand_acl($obj['allow_cid']);
$allow_groups = Group::expand(expand_acl($obj['allow_gid']));
$deny_people = expand_acl($obj['deny_cid']);
return $recipients;
}
- public static function getFeedTags($item) {
+ public static function getFeedTags($item)
+ {
$ret = [];
$matches = false;
$cnt = preg_match_all('|\#\[url\=(.*?)\](.*?)\[\/url\]|', $item['tag'], $matches);
return $ret;
}
- public static function expire($uid, $days, $network = "", $force = false) {
-
+ public static function expire($uid, $days, $network = "", $force = false)
+ {
if (!$uid || ($days < 1)) {
return;
}
}
/// @TODO: This query seems to be really slow
- public static function firstPostDate($uid, $wall = false) {
+ public static function firstPostDate($uid, $wall = false)
+ {
$r = q("SELECT `id`, `created` FROM `item`
WHERE `uid` = %d AND `wall` = %d AND `deleted` = 0 AND `visible` = 1 AND `moderated` = 0
AND `id` = `parent`