Re: Re: deleting messages

James A Baker <[email protected]>
Newsgroups gmane.mail.sqwebmail
Message-ID <[email protected]>
On Apr 26, 2004, at 14:59, Hugh Beaumont wrote:

> --- Jesse Guardiani <[email protected]> wrote:
>> On Monday 26 April 2004 15:04, Hugh Beaumont wrote:
>>> Hi,
>>>
>>> Was any progress ever made in regard to this thread:
>>> (from around May 2003)
>>> http://marc.theaimsgroup.com/?t=105180440400003&r=1&w=2
>>> Short version:
>>> Have sqwebmail hide deleted messages from the list of messages.
>> If anyone wants to take a shot at it, please, by all means, be my 
>> guest!
>
> I've been playing around some and it seems there are two ways to do 
> this:
> 1. hide the messages in the message list
> 2. actually do the proper delete/move to trash/whatever when the 
> delete button is pressed.
>
> Option 1 is (at first) pretty easy:
> I added:
>                 if (type[0] == MSGTYPE_DELETED)
>                   {
>                     continue;
>                   }
> near line 443 of folder.c
> This gets the messages out of the list but causes the message number 
> to be broken. For example if
> you delete messages #2, the list skips it.
> 1. message from here
> 3. message from here
> 4. message from here
>
> This causes a problem with the messages numbering. I've not looked at 
> how hard it would be to fix
> (it is more than just decrementing the message count though). Just 
> glancing at it I can imagine it
> getting a bit more complicated.
>

I don't believe -- unless you want to rewrite entire parts of the 
maildir reading library -- that this would be a feasible solution. ... 
And furthermore, those functions are shared with Courier's IMAP / POP 
servers, which would greatly complicate the process of making 
SqWebMail-specific changes to them.

I don't think that's a good route to go with... IMO.


> Option 2 would be the best method most likely.
>
> This all may be quickly solved (I'm just sort of playing around right 
> now and having fun thumbing
> through my old copy of K & R :)
>
>
> Now some questions:
>
> does anyone know of a previous reason why the messages are left around 
> in the folder list? Do some
> users have a use for this? The previous thread seemed to show that no 
> one had any good reason to
> keep them displayed.
>

Personally, I'm not aware of ever hearing Sam explicitly state why. But 
my assumption has always been that it's essentially "because that's how 
IMAP and POP work with the folders." Neither IMAP nor POP will actually 
delete messages from an active folder without some other "confirmation" 
action. In the case of IMAP, an explicit "EXPUNGE" command must be 
issued after the deletion to really delete the messages, IIRC. And in 
the case of POP, I don't believe the messages are actually removed 
after being marked as deleted, unless a successful "QUIT" command is 
issued to end the session.

So, my guess is that doing something different in SqWebMail's maildir 
handling would rather complicate the code.

Admittedly, there seems to be no "point" per se of still showing the 
messages, since SqWebMail has no un-delete command. -- But I personally 
feel that's an oversight.

If SqWebMail were to leave the deleted messages' checkboxes active, and 
included an "Undelete" command, then I believe this might very well be 
a more favorable solution than immediate deletions anyway in many 
cases.


> Also, does anyone use the message numbering? ie.
>
> 1. message one
> 2. message two
>
> etc..
>
> (the first column in the message list)
>
> Getting rid of this would solve 1/2 of the message number problem. The 
> other part would be the
> whole displaying messages 20-30 of 100 etc. It is the more complex of 
> the two.
>

Not really. Admittedly, the numbering as shown on the page, probably 
isn't used by anyone in any way whatsoever except as a visual indicator 
of where you are relatively in the list. However, the numbering upon 
which it is based (the "pos" variable) is used internally to SqWebMail, 
and can't be done away with -- at least not easily, and most probably 
not at all.

Furthermore, the "20-30 of 100" feature isn't really any more complex 
to change than the other numbering (though as I state above, that 
itself is more so than you probably imagine) and if the first is 
"properly" handled, should in fact work unmodified with whatever change 
you make. -- I can assure you of that since, as the author of that 
particular feature, I can *unequivocally* state that it uses the very 
same variables as the main numbering does... it in fact merely uses a 
couple of those pre-existing variables and displays them as part of a 
string. -- Well, I think it may define _one_ new one, but that one is 
simply used to store the value of adding "pos" and the size of the list 
as defined by your preferences. *shrug* No big there, since both of 
those values are in fact themselves pre-defined.


> I would appreciate any input. In most cases things are designed a 
> certain way for a reason so I'm
> curious in what way people currently use the message number display.
>

A good attitude in general to be sure. =)

I personally feel that the current method designed by Sam is primarily 
lacking in its inability to undelete messages, rather than it being the 
wrong way to do things altogether or anything like that. -- But I'm 
sure some might disagree with me. :-)

Anyway, there's my input. Hope it's helpful in some way.

-jab
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.