Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature] Option to mark message as read #30

Open
dipakparmar opened this issue Feb 18, 2022 · 5 comments
Open

[feature] Option to mark message as read #30

dipakparmar opened this issue Feb 18, 2022 · 5 comments

Comments

@dipakparmar
Copy link

It would be nice to mark the selected message as read after copying it to the clipboard. Can be turned on or off with env. variable.

@dipakparmar
Copy link
Author

something like this ...

$strdate = strtotime( date( 'Y-m-d H:i:s' ) );
$markedread = $db->query( 'update message SET is_read = 1, date_read = ' . $strdate . ' where ROWID = ' . $rowid )->fetch( PDO::FETCH_ASSOC );

@thebitguru
Copy link

Will this mark it as read on all devices, or just the current computer?

@dipakparmar
Copy link
Author

Currently don’t remember as haven't had time to add that to the PHP script, but as long iMessage sync is enabled, it should mark it read on all of the devices. (haven't confirmed the sync)

@madmaximux
Copy link

I would love to have this feature as well.

PS. I could test this out for you, just need to know how to grab the rowid and also what line to put this in.

@dipakparmar
Copy link
Author

@madmaximux you can access the ROWID from the message table eg. message.rowid see code in find-messages.php

$query = $db->query("
select
message.rowid,
ifnull(handle.uncanonicalized_id, chat.chat_identifier) AS sender,
message.service,
datetime(message.date / 1000000000 + 978307200, 'unixepoch', 'localtime') AS message_date,
message.text
from
message
left join chat_message_join
on chat_message_join.message_id = message.ROWID
left join chat
on chat.ROWID = chat_message_join.chat_id
left join handle
on message.handle_id = handle.ROWID
where
message.is_from_me = 0
and message.text is not null
and length(message.text) > 0
and (
message.text glob '*[0-9][0-9][0-9]*'
or message.text glob '*[0-9][0-9][0-9][0-9]*'
or message.text glob '*[0-9][0-9][0-9][0-9][0-9]*'
or message.text glob '*[0-9][0-9][0-9][0-9][0-9][0-9]*'
or message.text glob '*[0-9][0-9][0-9]-[0-9][0-9][0-9]*'
or message.text glob '*[0-9][0-9][0-9][0-9][0-9][0-9][0-9]*'
or message.text glob '*[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]*'
)
and datetime(message.date / 1000000000 + strftime('%s', '2001-01-01'), 'unixepoch', 'localtime')
>= datetime('now', '-$lookBackMinutes minutes', 'localtime')
order by
message.date desc
limit 100
");

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants