diff options
author | redmatrix <redmatrix@redmatrix.me> | 2015-06-23 21:01:59 -0700 |
---|---|---|
committer | redmatrix <redmatrix@redmatrix.me> | 2015-06-23 21:01:59 -0700 |
commit | 1a0655f34ea9979c7a08d21344d3e0eb9eb3246d (patch) | |
tree | 5dde4224a3c762bcc1935b2e67464939e57a60d2 /mod | |
parent | cb76fb8b9b659c4ec06e359f375a35a534927b99 (diff) | |
download | volse-hubzilla-1a0655f34ea9979c7a08d21344d3e0eb9eb3246d.tar.gz volse-hubzilla-1a0655f34ea9979c7a08d21344d3e0eb9eb3246d.tar.bz2 volse-hubzilla-1a0655f34ea9979c7a08d21344d3e0eb9eb3246d.zip |
more work on mail flags
Diffstat (limited to 'mod')
-rw-r--r-- | mod/mail.php | 5 | ||||
-rw-r--r-- | mod/manage.php | 3 | ||||
-rw-r--r-- | mod/ping.php | 15 |
3 files changed, 8 insertions, 15 deletions
diff --git a/mod/mail.php b/mod/mail.php index 1b0ea17c4..152db3231 100644 --- a/mod/mail.php +++ b/mod/mail.php @@ -145,8 +145,7 @@ function mail_content(&$a) { if(! intval(argv(2))) return; $cmd = argv(1); - $r = q("update mail set mail_flags = mail_flags | %d where id = %d and channel_id = %d", - intval(MAIL_RECALLED), + $r = q("update mail set mail_recalled = 1 where id = %d and channel_id = %d", intval(argv(2)), intval(local_channel()) ); @@ -312,7 +311,7 @@ function mail_content(&$a) { 'delete' => t('Delete message'), 'recall' => t('Recall message'), 'can_recall' => (($channel['channel_hash'] == $message['from_xchan']) ? true : false), - 'is_recalled' => (($message['mail_flags'] & MAIL_RECALLED) ? t('Message has been recalled.') : ''), + 'is_recalled' => (intval($message['mail_recalled']) ? t('Message has been recalled.') : ''), 'date' => datetime_convert('UTC',date_default_timezone_get(),$message['created'],'D, d M Y - g:i A'), ); diff --git a/mod/manage.php b/mod/manage.php index c86db55e8..a7327697d 100644 --- a/mod/manage.php +++ b/mod/manage.php @@ -78,9 +78,8 @@ function manage_content(&$a) { $channels[$x]['intros'] = intval($intr[0]['total']); - $mails = q("SELECT count(id) as total from mail WHERE channel_id = %d AND not (mail_flags & %d)>0 and from_xchan != '%s' ", + $mails = q("SELECT count(id) as total from mail WHERE channel_id = %d AND mail_seen = 0 and from_xchan != '%s' ", intval($channels[$x]['channel_id']), - intval(MAIL_SEEN), dbesc($channels[$x]['channel_hash']) ); diff --git a/mod/ping.php b/mod/ping.php index b093c1cab..719183388 100644 --- a/mod/ping.php +++ b/mod/ping.php @@ -163,10 +163,8 @@ function ping_init(&$a) { ); break; case 'messages': - $r = q("update mail set mail_flags = ( mail_flags | %d ) where channel_id = %d and not (mail_flags & %d) > 0", - intval(MAIL_SEEN), - intval(local_channel()), - intval(MAIL_SEEN) + $r = q("update mail set mail_seen = 1 where mail_seen = 0 and channel_id = %d ", + intval(local_channel()) ); break; case 'all_events': @@ -244,11 +242,9 @@ function ping_init(&$a) { if(argc() > 1 && argv(1) === 'messages') { $channel = $a->get_channel(); $t = q("select mail.*, xchan.* from mail left join xchan on xchan_hash = from_xchan - where channel_id = %d and not ( mail_flags & %d ) > 0 and not (mail_flags & %d ) > 0 + where channel_id = %d and mail_seen = 0 and mail_deleted = 0 and from_xchan != '%s' order by created desc limit 50", intval(local_channel()), - intval(MAIL_SEEN), - intval(MAIL_DELETED), dbesc($channel['channel_hash']) ); @@ -260,7 +256,7 @@ function ping_init(&$a) { 'url' => $zz['xchan_url'], 'photo' => $zz['xchan_photo_s'], 'when' => relative_date($zz['created']), - 'hclass' => (($zz['mail_flags'] & MAIL_SEEN) ? 'notify-seen' : 'notify-unseen'), + 'hclass' => (intval($zz['mail_seen']) ? 'notify-seen' : 'notify-unseen'), 'message' => t('sent you a private message'), ); } @@ -420,9 +416,8 @@ function ping_init(&$a) { if($vnotify & VNOTIFY_MAIL) { $mails = q("SELECT count(id) as total from mail - WHERE channel_id = %d AND not (mail_flags & %d) > 0 and from_xchan != '%s' ", + WHERE channel_id = %d AND mail_seen = 0 and from_xchan != '%s' ", intval(local_channel()), - intval(MAIL_SEEN), dbesc($channel['channel_hash']) ); if($mails) |