When an inbox message is sent to a group, and any member reads it, it is

marked as read by all members.
This commit is contained in:
Colin Kuskie 2009-05-28 17:01:24 +00:00
parent 1ec0ec5961
commit 368ef7d411
4 changed files with 62 additions and 2 deletions

View file

@ -428,8 +428,8 @@ sub setCompleted {
$self->{_inbox}{completedBy} = $userId;
$self->{_inbox}{completedOn} = time();
$self->session->db->setRow("inbox","messageId",$self->{_inbox});
#Completed messages should also be marked read
$self->setRead($userId);
#Completed messages should also be marked read for all users connected to this message
$self->setReadAll;
}
#-------------------------------------------------------------------
@ -478,6 +478,23 @@ sub setRead {
#-------------------------------------------------------------------
=head2 setReadAll ( )
Marks a message read for all users who are connected to this message
=cut
sub setReadAll {
my $self = shift;
$self->session->db->write(
q{update inbox_messageState set isRead=1 where messageId=?},
[$self->getId]
);
}
#-------------------------------------------------------------------
=head2 setReplied ( [ userId ] )
Marks a message replied.