// Never reorder or remove entries from this list. Just add new ones at the end, if needed.
// The item-activity table only stores the index and needs this array to know the matching activity.
- const ACTIVITIES = [ACTIVITY_LIKE, ACTIVITY_DISLIKE, ACTIVITY_ATTEND, ACTIVITY_ATTENDNO, ACTIVITY_ATTENDMAYBE];
+ const ACTIVITIES = [ACTIVITY_LIKE, ACTIVITY_DISLIKE, ACTIVITY_ATTEND, ACTIVITY_ATTENDNO, ACTIVITY_ATTENDMAYBE, ACTIVITY_FOLLOW, ACTIVITY2_ANNOUNCE];
private static $legacy_mode = null;
return $ret;
}
+
+ /**
+ * Is the given item array a post that is sent as starting post to a forum?
+ *
+ * @param array $item
+ * @param array $owner
+ *
+ * @return boolean "true" when it is a forum post
+ */
+ public static function isForumPost(array $item, array $owner = [])
+ {
+ if (empty($owner)) {
+ $owner = User::getOwnerDataById($item['uid']);
+ if (empty($owner)) {
+ return false;
+ }
+ }
+
+ if (($item['author-id'] == $item['owner-id']) ||
+ ($owner['id'] == $item['contact-id']) ||
+ ($item['uri'] != $item['parent-uri']) ||
+ $item['origin']) {
+ return false;
+ }
+
+ return Contact::isForum($item['contact-id']);
+ }
}