[buddypress-trac] [BuddyPress Trac] #8581: Extending no content activities with images and call of actions

buddypress-trac noreply at wordpress.org
Mon Nov 22 21:13:17 UTC 2021


#8581: Extending no content activities with images and call of actions
-----------------------------+---------------------
 Reporter:  vapvarun         |       Owner:  (none)
     Type:  feature request  |      Status:  new
 Priority:  normal           |   Milestone:  10.0.0
Component:  Activity         |     Version:
 Severity:  normal           |  Resolution:
 Keywords:  has-patch        |
-----------------------------+---------------------
Changes (by imath):

 * keywords:  needs-refresh => has-patch


Comment:

 Here’s the
 [https://buddypress.trac.wordpress.org/attachment/ticket/8581/8581-b.patch
 patch] I’m suggesting about the need to use the profile image file the way
 it was at the time when the activity was generated (the `b.` point of my
 previous [#comment:7 comment]).

 1. Improve the BP Attachments API so that it can manage file revisions (It
 will be useful for the BP Attachments feature as a plugin) and
 avatar/cover images history.
 2. Instead of deleting an avatar when it’s being changed, move it to an
 `history` subdirectory.
 3. Avoid using an activity meta to store the previous avatar. Instead, use
 the date the activity was created on and edit the way we name avatars so
 that it uses a timestamp instead of `uniqid()`. To achieve this I had to
 edit a bunch of functions to transport the exact same timestamp the
 avatars were created inside the `bp_members_new_avatar_activity` function
 to use this timestamp as the activity date.
 4. Introduce 2 new core functions: `bp_attachments_list_directory_files()`
 and `bp_attachments_list_directory_files_recursively()`. The second one
 help use to return the current and historical avatars inside a flat array.
 5. Introduce the `bp_avatar_get_version_src()` function to get the user
 avatar according to the date it was created.
 6. Force `bp_activity_has_content()` to be true for `new_avatar` activity
 having an existing avatar for the activity date. See the
 [https://github.com/imath/buddypress/blob/patch/8581-b/src/bp-activity/bp-
 activity-template.php#L1434|L1459 code here].
 7. Add a late filter to `’bp_get_activity_content_body’` to generate the
 rich content. See the
 [https://github.com/imath/buddypress/blob/patch/8581-b/src/bp-activity/bp-
 activity-filters.php#L845|L876 code here]. For now it simply outputs the
 avatar.

 @vapvarun you’ll be mostly interested in 6 & 7 to generate your rich
 content.

 NB: when possible we should always try to avoid template actions such as
 `'bp_activity_entry_content’` as these kind of actions might miss inside
 some overrides.

-- 
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/8581#comment:17>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list