[buddypress-trac] [BuddyPress Trac] #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 Feb 20 20:44:14 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 needs-testing |
-------------------------------------------------+-----------------------
Comment (by boonebgorges):
> So in 5328.04.diff i've removed all caching stuff.
Yeah, this seems right to me.
> I understand your prudence (< i don't know if it's the same meaning in
english than in french)
Oui, c'est exact :)
I think this is just about ready to go. 5328.05.diff contains a few
changes:
- I changed the 'offset' param so that passing 'offset=35' would get items
*greater than or equal to* 35, instead of greater than. This seems more
like how "offset" should work, and it seems like it's how WP_Query handles
its own offset parameter. I made the necessary +1 change in the code so
that the heartbeat would continue to work.
- Unit test for 'offset'
- Some documentation and codestyling cleanup
- I like your new logic for setting the pulse interval, but I rewrote the
documentation and flipped around some variable names inside of
`bp_activity_heartbeat_strings()` so that it made a bit more sense. (Some
of the logic you were using before was kinda opaque - it took me like 20
minutes to understand the function :) )
- I changed the wording of the admin setting
(bp_admin_setting_callback_heartbeat()). For one thing, "15 seconds" was
not always going to be literally true. For another, the word "refresh" is
a little misleading - the page doesn't really refresh, it just checks to
see if there's new items available. I changed it to "Query automatically
for new items when viewing the activity stream", but if you have ideas for
how that could be improved, please feel free.
- Messed with your JS a little bit so that one of the jQuery objects would
get cached in a variable
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/5328#comment:18>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac
More information about the buddypress-trac
mailing list