[#14943] Horde_Imap_Client_Data_Thread getRawData()
Summary Horde_Imap_Client_Data_Thread getRawData()
Queue Horde Framework Packages
Type Enhancement
State Feedback
Priority 1. Low
Owners mrubinsk (at) horde (dot) org
Requester mariusz.goch (at) spacja (dot) com
Created 2019-08-20 (31 days ago)
Updated 2019-09-19 (yesterday)
Patch No

2019-09-19 19:00:36 mariusz (dot) goch (at) spacja (dot) com Comment #5
New Attachment: thread_getThreads.patch Download
Reply to this comment
My scenario is simple. I'm presenting to the user list of all his 
threads with summary. User than can pick one to view all messages in 
this conversation. After user picks anything getThread() works fine 
but there was a problem presenting whole list of threads. In fact I''m 
presenting last 50 but IMAP does not allow paging in thread so I've 
managed this on my own. Thankfully horde cache kicks in.

Anyway. II'm attaching patch with getThreads() method that result with 
same array of threads with the same structures that are returned from 

Best regards
2019-09-17 02:21:13 Michael Rubinsky Assigned to Michael Rubinsky
State ⇒ Feedback
2019-09-17 02:20:53 Michael Rubinsky Comment #4 Reply to this comment
getThread() requires UID.
For the record, it could also be a sequence number. It depends on the 
options passed to Horde_Imap_Client_Base::thread().
So first I've got to fetch all messages to get UIDs, then fetch 
threads one by one.
Not sure what you mean by you have to fetch all messages to get UIDs. 
You shouldn't have to fetch anything else from the server after the 
call to $imapOb->thread() to get UUIDs. 
Horde_Imap_Client_Data_Thread::messageList() will return the (sorted) 
list of all UUIDs that matched the search option in the thread() call. 
While this list doesn't give you the thread structure, it would be 
fairly easy to construct it by iterating once through the messageList().

Not sure exactly what your use case is here for having access to the 
entire mailbox's thread sort like this, but I can see where they may 
be some value in having that data exposed. I'd consider a patch that 
outputs this as a more formal structure.

2019-09-16 16:34:01 mariusz (dot) goch (at) spacja (dot) com Comment #3 Reply to this comment
I now it was removed but there is still no alternative.
When I want to show all threads there is now easy way.
getThread() requires UID. So first I've got to fetch all messages to 
get UIDs, then fetch threads one by one.
In this usage getThread() is really a performance issue because in 
each call it go through whole array.
In mailbox that has few thousand messages should I call few thousand 
times getThread() and any single time getThread() will search through 
whole cached array.
Instead getThread() there could be getThreads() that will return same 
structure for all threads.
If this would be acceptable I will be happy to provide a patch.

2019-09-14 15:55:10 Michael Rubinsky Comment #2
State ⇒ Rejected
Reply to this comment
This was removed over 7 years ago, when version 2.0.0 of this library 
was released. The data that getRawData() would expose is considered 
internal to the class. The data structure may change, be improved 
etc.... exposing it publicly introduces restrictions on what we can 
change without breaking backwards compatibility.

2019-08-20 11:03:13 mariusz (dot) goch (at) spacja (dot) com Comment #1
Type ⇒ Enhancement
State ⇒ New
Priority ⇒ 1. Low
Summary ⇒ Horde_Imap_Client_Data_Thread getRawData()
Queue ⇒ Horde Framework Packages
Milestone ⇒
Patch ⇒ No
Reply to this comment
In class Horde_Imap_Client_Data_Thread why there is no getRawData() 
method any more?? There was one some time ago, before internal format 
Now you can only iterate through getThread() and every time it's 
called there is a loop across all threads. It's OK when I just want to 
show information about one thread but when I want to show all threads 
in a list in large mailboxes it's a real performance issue.
Simple getRawData() returning internal data would allow to customize this.

Saved Queries