RoundCube Webmail Forum  

Go Back   RoundCube Webmail Forum > SVN Releases > Requests

For more information about the ads and why they're here, please see the FAQ
Reply
  #11  
Old 08-10-2006, 07:25 PM
Registered User
 
Join Date: Aug 2006
Posts: 9
Downloads: 0
Uploads: 0
Default Re: I'm implementing tags (aka labels)

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?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #12  
Old 08-10-2006, 08:41 PM
Registered User
 
Join Date: Jun 2006
Posts: 40
Downloads: 0
Uploads: 0
Send a message via Yahoo to EricS
Default Re: I'm implementing tags (aka labels)

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #13  
Old 08-10-2006, 11:33 PM
Registered User
 
Join Date: Aug 2006
Posts: 9
Downloads: 0
Uploads: 0
Default Re: I'm implementing tags (aka labels)

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 =])
Attached Files
File Type: txt clean_up_magic_flags.patch.txt (4.7 KB, 6 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #14  
Old 08-11-2006, 03:05 AM
Registered User
 
Join Date: Aug 2006
Posts: 9
Downloads: 0
Uploads: 0
Default Re: I'm implementing tags (aka labels)

Forgot \Flagged.
Use this patch instead.
Attached Files
File Type: txt clean_up_magic_flags_secondtry.patch.txt (5.2 KB, 5 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #15  
Old 08-11-2006, 03:27 AM
Registered User
 
Join Date: Aug 2006
Posts: 9
Downloads: 0
Uploads: 0
Default Re: I'm implementing tags (aka labels)

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!
Attached Files
File Type: txt magic_flags_fixed.patch.txt (7.1 KB, 12 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #16  
Old 08-11-2006, 03:54 PM
Registered User
 
Join Date: Jun 2006
Posts: 40
Downloads: 0
Uploads: 0
Send a message via Yahoo to EricS
Default Re: I'm implementing tags (aka labels)

I like what you've described in the summary - I'll try to give the patch a thorough review today.
Thanks!
-Eric
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #17  
Old 08-29-2006, 10:25 AM
GunFro's Avatar
Registered User
 
Join Date: Jun 2006
Posts: 31
Downloads: 0
Uploads: 0
Send a message via ICQ to GunFro Send a message via AIM to GunFro Send a message via MSN to GunFro
Default Re: I'm implementing tags (aka labels)

Hi.
Whats the use in having folders and labels ?
Please don't let this be a future feature in this otherwise wonderful 'program'.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #18  
Old 09-07-2006, 11:57 PM
Registered User
 
Join Date: Sep 2006
Posts: 1
Downloads: 0
Uploads: 0
Default Re: I'm implementing tags (aka labels)

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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

For more information about the ads and why they're here, please see the FAQ

All times are GMT. The time now is 11:35 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
Copyright © 2006-2008 RoundCube Webmail Community