Need advice

View: New views
8 Messages — Rating Filter:   Alert me  

Need advice

by Michael Rasmussen-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi all,

I need some advice for my archiver plugin regarding collecting the
messages to be archived.

My ideas at the moment is this:
1) Using the folder requested by the user, decide how many messages the
folder contains.
2) Find which messages are cached locally and archive those.
3) Fetch the rest from the server.

Questions to item
1)
    - How can I decide how many messages a folder has if the folder in
question is a sub folder of INBOX?
    - Does POP3 operate with sub folders?
2)
    - How can I decide which messages are cached and which to fetch
from the server?
    - Is there a fetch-all function which deals with this?
    - How do I avoid caching locally the ones I fetch, or should I do
this since the messages will be fetch anyway?
3)  - Is there a function I can call which will hide all
server/protocol related stuff?
    - The way I see it there seems to be no taxonomic difference
between a mail folder, a news folder, a feed folder, and a calendar
folder. Is this a false assumption?

--
Hilsen/Regards
Michael Rasmussen

Get my public GnuPG keys:
michael <at> rasmussen <dot> cc
http://keyserver.veridis.com:11371/pks/lookup?op=get&search=0xD3C9A00E
mir <at> datanom <dot> net
http://keyserver.veridis.com:11371/pks/lookup?op=get&search=0xE501F51C
mir <at> miras <dot> org
http://keyserver.veridis.com:11371/pks/lookup?op=get&search=0xE3E80917
--------------------------------------------------------------
You feel a whole lot more like you do now than you did when you used to.


signature.asc (196 bytes) Download Attachment

Re: Need advice

by Colin Leroy :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 12 May 2008 at 10h05, Michael Rasmussen wrote:

Hi,

Basically: just use the normal API and let Claws handle its stuff :)

> Questions to item
> 1)
>     - How can I decide how many messages a folder has if the folder in
> question is a sub folder of INBOX?

Use FolderItem->total_msgs

>     - Does POP3 operate with sub folders?

Don't bother about the underlying folder stuff:
Use
GSList *msglist = folder_item_get_msg_list(item);
GSList *cur;
for (cur = msglist; cur; cur = cur->next) {
        gchar *file = procmsg_get_message_file(MsgInfo *msginfo);
        //do stuff with your file that contains the message
}
procmsg_msg_list_free(msglist);

>     - How can I decide which messages are cached and which to fetch
> from the server?

Let Claws decide it :)

>     - Is there a fetch-all function which deals with this?

The previous loop does this.

>     - How do I avoid caching locally the ones I fetch, or should I do
> this since the messages will be fetch anyway?

Let Claws cache them, it's better.

> 3)  - Is there a function I can call which will hide all
> server/protocol related stuff?

See previously :)

>     - The way I see it there seems to be no taxonomic difference
> between a mail folder, a news folder, a feed folder, and a calendar
> folder. Is this a false assumption?

No, it's completely true. By using folder_item_get_msg_list() and
procmsg_get_message_file, you don't even need to know what kind of
folder you're operating on.

HTH,
--
Colin


signature.asc (196 bytes) Download Attachment

Re: Need advice

by Michael Rasmussen-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Mon, 12 May 2008 11:18:16 +0200
Colin Leroy <colin@...> wrote:

>
> No, it's completely true. By using folder_item_get_msg_list() and
> procmsg_get_message_file, you don't even need to know what kind of
> folder you're operating on.
>
I was studying the file procmsg.h after sending my mail and found more
or less answers to all my questions in this file. FOSS is a god thing
-> show me the source, Luke:-)

PS. added and appetizer showing the GUI for the plugin. As can be seen
it is obeying claws-mails minimalistic approach:-)


--
Hilsen/Regards
Michael Rasmussen

Get my public GnuPG keys:
michael <at> rasmussen <dot> cc
http://keyserver.veridis.com:11371/pks/lookup?op=get&search=0xD3C9A00E
mir <at> datanom <dot> net
http://keyserver.veridis.com:11371/pks/lookup?op=get&search=0xE501F51C
mir <at> miras <dot> org
http://keyserver.veridis.com:11371/pks/lookup?op=get&search=0xE3E80917
--------------------------------------------------------------
Don't use conditional branches as a substitute for a logical expression.
            - The Elements of Programming Style (Kernighan & Plaugher)



archive.png (21K) Download Attachment
signature.asc (196 bytes) Download Attachment

Re: Need advice

by Holger Berndt :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Mo, 12.05.2008 11:31, Michael Rasmussen wrote:

>PS. added and appetizer showing the GUI for the plugin. As can be seen
>it is obeying claws-mails minimalistic approach:-)

Is there a reason that the user has to enter folder and file name
separately? Why not use for example a single GtkFileChooserButton?

Holger

---------------------------------------------------------------------
To unsubscribe, e-mail: claws-mail-devel-unsubscribe@...
For additional commands, e-mail: claws-mail-devel-help@...


Re: Need advice

by Michael Rasmussen-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Mon, 12 May 2008 15:22:52 +0200
Holger Berndt <berndth@...> wrote:

>
> Is there a reason that the user has to enter folder and file name
> separately? Why not use for example a single GtkFileChooserButton?
>
The reason is that the user will be able to specify any folder in the
folder view, also sub folders if that's preferred. E.g a user only
wants the messages in folder "work-related" which is a virtual folder
populated by a rule or and action script.

--
Hilsen/Regards
Michael Rasmussen

Get my public GnuPG keys:
michael <at> rasmussen <dot> cc
http://keyserver.veridis.com:11371/pks/lookup?op=get&search=0xD3C9A00E
mir <at> datanom <dot> net
http://keyserver.veridis.com:11371/pks/lookup?op=get&search=0xE501F51C
mir <at> miras <dot> org
http://keyserver.veridis.com:11371/pks/lookup?op=get&search=0xE3E80917
--------------------------------------------------------------
The Principal of Greenbow County Central Schools: "Your
momma sure does care 'bout your schoolin' son"


signature.asc (196 bytes) Download Attachment

Re: Need advice

by Holger Berndt :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Mo, 12.05.2008 15:46, Michael Rasmussen wrote:

>On Mon, 12 May 2008 15:22:52 +0200
>Holger Berndt <berndth@...> wrote:
>
>>
>> Is there a reason that the user has to enter folder and file name
>> separately? Why not use for example a single GtkFileChooserButton?
>>
>The reason is that the user will be able to specify any folder in the
>folder view, also sub folders if that's preferred. E.g a user only
>wants the messages in folder "work-related" which is a virtual folder
>populated by a rule or and action script.

Oh, I missunderstood the UI. I thought this is the folder into which
the archive will be saved, as I thought the option to archive a folder
is in the folder context menu and thus an additional selection of the
mail folder is not necessary.

Anyways, misinterpretation on my side. Forget about it.

Holger

---------------------------------------------------------------------
To unsubscribe, e-mail: claws-mail-devel-unsubscribe@...
For additional commands, e-mail: claws-mail-devel-help@...


Re: Need advice

by Michael Rasmussen-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Mon, 12 May 2008 15:53:23 +0200
Holger Berndt <berndth@...> wrote:

>
> Oh, I missunderstood the UI. I thought this is the folder into which
> the archive will be saved, as I thought the option to archive a folder
> is in the folder context menu and thus an additional selection of the
> mail folder is not necessary.
>
I was preferring to add it to the context menu, but doing this is not
an easy task since this requires rewriting claws API.

So this way is a go-between the preferred to the impossible:-)

--
Hilsen/Regards
Michael Rasmussen

Get my public GnuPG keys:
michael <at> rasmussen <dot> cc
http://keyserver.veridis.com:11371/pks/lookup?op=get&search=0xD3C9A00E
mir <at> datanom <dot> net
http://keyserver.veridis.com:11371/pks/lookup?op=get&search=0xE501F51C
mir <at> miras <dot> org
http://keyserver.veridis.com:11371/pks/lookup?op=get&search=0xE3E80917
--------------------------------------------------------------
Debian Hint #21: If your Debian box is behind a slow network connection,
but you have access to a fast one as well, check out the apt-zip
package.


signature.asc (196 bytes) Download Attachment

Re: Need advice (bug in vcalendar?)

by Michael Rasmussen-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Mon, 12 May 2008 11:18:16 +0200
Colin Leroy <colin@...> wrote:

> Use
> GSList *msglist = folder_item_get_msg_list(item);
> GSList *cur;
> for (cur = msglist; cur; cur = cur->next) {
> gchar *file = procmsg_get_message_file(MsgInfo *msginfo);
> //do stuff with your file that contains the message
> }
> procmsg_msg_list_free(msglist);
>
Works like a charm. But I might have discovered a bug in vcalendar
plugin. Study the following messages:
vcal_folder.c:968: fetch for
http://mir:Dupago@.../caldav.php/mir/home/ 11
vcal_folder.c:925:numlist null
procmsg.c:405:can't fetch message 11
archiver_gtk.c:69:Processing: (null)

http://mir:Dupago@.../caldav.php/mir/home/ 11 looks
wrong to me?

--
Hilsen/Regards
Michael Rasmussen

Get my public GnuPG keys:
michael <at> rasmussen <dot> cc
http://keyserver.veridis.com:11371/pks/lookup?op=get&search=0xD3C9A00E
mir <at> datanom <dot> net
http://keyserver.veridis.com:11371/pks/lookup?op=get&search=0xE501F51C
mir <at> miras <dot> org
http://keyserver.veridis.com:11371/pks/lookup?op=get&search=0xE3E80917
--------------------------------------------------------------
die_if_kernel("Kernel gets FloatingPenguinUnit disabled trap", regs);
        linux-2.2.16/arch/sparc/kernel/traps.c


signature.asc (196 bytes) Download Attachment
LightInTheBox - Buy quality products at wholesale price!