![]() |
|
|
|||||||
| For more information about the ads and why they're here, please see the FAQ |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
#11
|
|||
|
|||
|
Yeah, that makes sense. I'll make ill_C_ModFlag a little bit smarter, and I'll have everything in rcube_imap.inc that calls it use the magic flags when appropriate. I'll provide convenience functions in $IMAP's class (rcube_imap.inc) for changing the magic flags, but I won't change any code to use them yet.
--update I have really, really got to read through this code more before I start changing things! It turns out the code DOESN'T directly call iil_C_ModFlag with the magical capitalized strings! $IMAP->set_flag seems to be a spof, and it has a bit of logic to call magic functions. New plan: (dizzying how fast things change, isn't it!) - add more magic-flag functions to lib/imap.inc - $IMAP->set_flag will use the magic-flag functions for all its operations - iil_C_ModFlag will preserve its argument, including backslashes and case - magic-flag functions will user proper backslashes and case - add $IMAP->label_message and $IMAP->unlabel_message, which will call newly modified iil_C_ModFlag --update: redefining the semantics for iil_C_Flag and _Unflag to do this. --update Things to do later - make drafts set \Draft flag! - do we set \Answered? |
|
#12
|
|||
|
|||
|
That sounds like a good approach. Let me know when you have something to look at, and I'll be happy to give it a 2nd look!
![]() -Eric |
|
#13
|
|||
|
|||
|
Here's a patch for the first two steps.
Summary of changes: include/rcube_imap.inc - $IMAP->set_flag is now solely intended for magic flags. - set_flag uses a map from strings like "SEEN" to function names like iil_C_Seen, to determine which function to call, and call_user_func to make the call. - At the end of set_flag, there is an if/elseif/elseif to update the cached messagecount. All three branches of the if checked $result. Now, there is an if($result) wrapping them. This will save like two cycles =D lib/imap.inc - Existing functions iil_C_Unseen, _Delete, and _Undelete reordered =] - Added functions iil_C_Draft, _Undraft, _Answered, _Unanswered, _Seen; which twiddle the appropriate IMAP magic flag. They call iil_C_ModFlag. These are internal changes; there should be no detectable change in program operation. I've tested this briefly with mark seen/unseen, and it seems to work. I'd appreciate a quick review from EricS or anyone else following this thread. Thanks! (btw, could someone allow uploads of .patch files? .patch.txt is silly =]) |
|
#14
|
|||
|
|||
|
Forgot \Flagged.
Use this patch instead. |
|
#15
|
|||
|
|||
|
Stage two complete:
- iil_C_ModFlag performs no translation on the flags it is passed as input. Validation is left to the caller. Spaces will cause multiple flags to be affected; stray parentheses are probably a very bad idea. - iil_C_Seen, _Unseen, and so forth now use proper \Seen etc flags - iil_C_FetchHeaders pulls all the flags without translation - it doesn't drop the backslashes - iil_C_Flag and _Unflag are now generalized - they will be used for tags! Once again, this should cause no detectable change in operation. This patch depends upon, and includes, the previous patch ("clean_up_magic_flags_secondtry.patch.txt". I know, I need better names.) This oughta be the end of the internal re-jiggering. From now on it's all new code! |
|
#16
|
|||
|
|||
|
I like what you've described in the summary - I'll try to give the patch a thorough review today.
Thanks! ![]() -Eric |
|
#17
|
||||
|
||||
|
Hi.
Whats the use in having folders and labels ? Please don't let this be a future feature in this otherwise wonderful 'program'. |
|
#18
|
|||
|
|||
|
This is definitely something I would LOVE to see implemented. I'm more than willing to help out with testing when it gets off the ground.
S. |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
| For more information about the ads and why they're here, please see the FAQ |