[buddypress-trac] [BuddyPress Trac] #6221: messages-loop.php executes BP_Messages_Thread::populate() twice per conversation

buddypress-trac noreply at wordpress.org
Tue Apr 7 04:18:13 UTC 2015


#6221: messages-loop.php executes BP_Messages_Thread::populate() twice per
conversation
------------------------------------+------------------
 Reporter:  wpdennis                |       Owner:
     Type:  enhancement             |      Status:  new
 Priority:  normal                  |   Milestone:  2.3
Component:  Component - Messaging   |     Version:
 Severity:  normal                  |  Resolution:
 Keywords:  dev-feedback has-patch  |
------------------------------------+------------------
Changes (by r-a-y):

 * keywords:  dev-feedback reporter-feedback => dev-feedback has-patch


Comment:

 `01.patch` basically handles Boone's point 1 in comment:6.

 * Introduces `BP_Messages_Thread::get_messages()` - caches fetching
 messages by thread ID
 * Introduces `BP_Messages_Thread::get_recipients_by_thread()` - Static
 method so we can reference the existing `get_recipients()` method for easy
 access.
 * Converts `BP_Messages_Thread::check_access()` and
 `BP_Messages_Thread::is_valid()` methods from using direct DB queries to
 reference the cache.
 * Includes unit tests.

 This handles the majority of uncached message DB queries.

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


More information about the buddypress-trac mailing list