6.0.0-beta1
7/7/25

[#14943] Horde_Imap_Client_Data_Thread getRawData()
Summary Horde_Imap_Client_Data_Thread getRawData()
Queue Horde Framework Packages
Type Enhancement
State Resolved
Priority 1. Low
Owners mrubinsk (at) horde (dot) org
Requester mariusz.goch (at) spacja (dot) com
Created 08/20/2019 (2148 days ago)
Due
Updated 09/29/2019 (2108 days ago)
Assigned
Resolved 09/29/2019 (2108 days ago)
Milestone
Patch No

History
09/29/2019 06:45:51 PM Git Commit Comment #11 Reply to this comment
Changes have been made in Git (master):

commit a4ed34a22e7cf59d7af60a172cb8bcb4fcde445b
Author: Michael J Rubinsky <mrubinsk@horde.org>
Date:   Sun, 29 Sep 2019 14:45:19 -0400

[mjr] Support returning entire thread list (Ticket #14943
mariusz.goch@spacja.com).

  M .horde.yml
  M composer.json
  M doc/Horde/Imap/Client/CHANGES
  M doc/Horde/Imap/Client/changelog.yml
  M package.xml

https://github.com/horde/Imap_Client/commit/a4ed34a22e7cf59d7af60a172cb8bcb4fcde445b
09/29/2019 06:43:57 PM Michael Rubinsky Comment #10
State ⇒ Resolved
Reply to this comment
Committed and released, thanks!
09/29/2019 06:33:47 PM Git Commit Comment #9 Reply to this comment
Changes have been made in Git (FRAMEWORK_5_2):

commit 4fd4e120356b4a58053ab7b652cba0d4c04479d1
Author: Michael J Rubinsky <mrubinsk@horde.org>
Date:   Sun, 29 Sep 2019 14:33:37 -0400

[mjr] Support returning entire thread list (Ticket #14943
mariusz.goch@spacja.com).

  M doc/Horde/Imap/Client/CHANGES
  M package.xml

https://github.com/horde/Imap_Client/commit/4fd4e120356b4a58053ab7b652cba0d4c04479d1
09/29/2019 06:33:46 PM Git Commit Comment #8 Reply to this comment
Changes have been made in Git (FRAMEWORK_5_2):

commit e43f7439c14817e893f4ea62a94d49db18b27ac7
Author: Michael J Rubinsky <mrubinsk@horde.org>
Date:   Sun, 29 Sep 2019 14:33:37 -0400

[mjr] Support returning entire thread list (Ticket #14943
mariusz.goch@spacja.com).

  M doc/Horde/Imap/Client/changelog.yml

https://github.com/horde/Imap_Client/commit/e43f7439c14817e893f4ea62a94d49db18b27ac7
09/29/2019 06:33:45 PM Git Commit Comment #7 Reply to this comment
Changes have been made in Git (FRAMEWORK_5_2):

commit 8fe3c993496325cf94b2f99869283ba3878c0915
Author: Michael J Rubinsky <mrubinsk@horde.org>
Date:   Sun, 29 Sep 2019 14:32:31 -0400

Ticket: 14943  Support returning entire thread list.

mariusz.goch@spacja.com

  M lib/Horde/Imap/Client/Data/Thread.php

https://github.com/horde/Imap_Client/commit/8fe3c993496325cf94b2f99869283ba3878c0915
09/29/2019 06:32:06 PM Git Commit Comment #6 Reply to this comment
Changes have been made in Git (master):

commit 15f5250ff0f7e8d40c1d401c862f2285ca50d33f
Author: Michael J Rubinsky <mrubinsk@horde.org>
Date:   Sun, 29 Sep 2019 14:30:41 -0400

Ticket: 14943  Support returning entire thread list.

mariusz.goch@spacja.com

  M lib/Horde/Imap/Client/Data/Thread.php

https://github.com/horde/Imap_Client/commit/15f5250ff0f7e8d40c1d401c862f2285ca50d33f
09/19/2019 07:00:36 PM 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 
getThread().

Best regards
09/17/2019 02:21:13 AM Michael Rubinsky State ⇒ Feedback
Assigned to Michael Rubinsky
 
09/17/2019 02:20:53 AM 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.

09/16/2019 04:34:01 PM 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.




09/14/2019 03:55:10 PM 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.


08/20/2019 11:03:13 AM mariusz (dot) goch (at) spacja (dot) com Comment #1
Patch ⇒ No
State ⇒ New
Milestone ⇒
Queue ⇒ Horde Framework Packages
Summary ⇒ Horde_Imap_Client_Data_Thread getRawData()
Type ⇒ Enhancement
Priority ⇒ 1. Low
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 
changed.
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