[buddypress-trac] [BuddyPress] #5328: Use of the WordPress HeartBeat API to check for newest activities and to let user load them

buddypress-trac noreply at wordpress.org
Thu Jan 9 07:59:48 UTC 2014


#5328: Use of the WordPress HeartBeat API to check for newest activities and to
let user load them
-----------------------------------+-----------------------
 Reporter:  imath                  |       Owner:  imath
     Type:  enhancement            |      Status:  assigned
 Priority:  normal                 |   Milestone:  2.0
Component:  Activity               |     Version:  1.9.1
 Severity:  normal                 |  Resolution:
 Keywords:  has-patch 2nd-opinion  |
-----------------------------------+-----------------------
Changes (by imath):

 * owner:   => imath
 * status:  new => assigned


Comment:

 Replying to [comment:3 boonebgorges]:
 > Wow, this is really great.
 Thanks Boone, yes using latest_id should really ease the process and i
 think to turn it off a new setting in the Activity section would be nice

 Replying to [comment:4 henry.wright]:
 > Wow, this is really great. (...) Alternatively you could check every 30
 seconds instead of every 15?
 Thanks Henry, Henry & @mpa4hu : to change the pulse i think the best is to
 introduce a filter in the function i use to change WordPress's one. This
 way we can still check the filtered value is in the WordPress 'allowed'
 range of values : 15 to 60 seconds, and we keep things simple for
 administrators in the BuddyPress settings area : turn it on / turn it off


 I think, we also need to consider 'activity posting' when the link 'Load
 newest' is displayed, by taking in account active tab (potential tabs :
 All Members, My Friends, My Groups, My Favorites, Mentions) & selected
 filter on The Activity directory page.

 The way last date_recorded (which will soon be last id recorded) is get is
 taking in account scope & filter. For instance if on the "My Groups" tab,
 the link "load newest" won't be displayed even if there's a newest
 activity if it's not a "group component" one (i think i need to improve
 what i've done by also checking the user_id).

 The way an activity is posted then displayed into the stream doesn't care
 about the active tab or active filter. For instance : if on the 'Mentions'
 tab, when posting a new activity it is displayed before the mentions. If
 you click again on the 'Mentions' tab it "disappears" ;)
 And this is fine as it shows the user his activity has been posted.

 Now, in the state the patch is : if the 'Load Newest' link is displayed
 and an activity is posted, the activity will be displayed before the 'Load
 Newest' link and when clicking on it older activities than the 'just
 posted' activity will be displayed before the 'just posted' one. As a
 result the chronology of the stream will temporarily be messed up till the
 complete reload of the page.

 So to make the patch evolve the best way, i think we need to "rethink"
 about the way a just posted activity is displayed.
  1- if the link "load newest" is displayed then in
 {{{bp_legacy_theme_post_update}}} the argument of bp_has_activities
 shouldn't be "include" but something like 'last_id' displayed on the
 stream so that the chronology of the stream is respected.
  2- an extra class might be temporarily added to the just_posted activity
 to show the user, his activity has been posted as more than one will be
 displayed.
  3- which would actually be the first step  : i think we need to be sure
 the filter & scope are : activity_update & All Members. The easiest way to
 do that is to trigger some actions on the textarea focus if it's not the
 case.

 Sorry for that quite long comment ;) But i needed to write these thoughts
 to have your opinion about them.

--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/5328#comment:6>
BuddyPress <http://buddypress.org/>
BuddyPress


More information about the buddypress-trac mailing list