[Users] Mark as read/unread

Holger Berndt berndth at gmx.de
Tue Aug 12 23:23:42 CEST 2014


On Mo, 11.08.2014 11:45, Ricardo Mones wrote:

>  This can already be achieved with Python plugin. Place this into some
>file.py in your ~/.claws-mail/python-scripts/main directory and refresh
>your python scripts:
>
>-------
># get actions
>action_group = clawsmail.get_mainwindow_action_group()
>action_unmark = action_group.get_action("Message/Mark/Unmark")
>action_mark = action_group.get_action("Message/Mark/Mark")
># process selected messages
>for msg in clawsmail.get_summaryview_selected_message_list():
>        clawsmail.summaryview_select_messages([msg])
>        if msg.is_marked():
>                action_unmark.activate()
>        else:
>                action_mark.activate()
>
>-------

That works, however, it's a bit clunky due to missing API. I just
pushed a commit that adds read/write attributes for the "unread",
"locked" and "marked" flags, and read-only attributes for the "new",
"replied" and "forwarded" flags (deprecating the respective is_FLAG()
methods). So with git master, you can now do

#------------------------------
for msg in clawsmail.get_summaryview_selected_message_list():
    msg.unread = not msg.unread
#------------------------------

to toggle the "unread" attribute.

Holger
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: OpenPGP digital signature
URL: <http://lists.claws-mail.org/pipermail/users/attachments/20140812/bc1ac0dc/attachment.sig>


More information about the Users mailing list