mirror of
https://github.com/Mibew/tray.git
synced 2025-01-22 18:10:34 +03:00
Update threads history
Do not show threads related with ignored or rejected invitations.
This commit is contained in:
parent
bc287f0e11
commit
3fc6218332
@ -49,7 +49,9 @@ if ($query !== false) {
|
|||||||
$page['groupName'] = $groupName;
|
$page['groupName'] = $groupName;
|
||||||
|
|
||||||
$values = array(
|
$values = array(
|
||||||
':query' => "%{$query}%"
|
':query' => "%{$query}%",
|
||||||
|
':invitation_accepted' => Thread::INVITATION_ACCEPTED,
|
||||||
|
':invitation_not_invited' => Thread::INVITATION_NOT_INVITED
|
||||||
);
|
);
|
||||||
|
|
||||||
$searchConditions = array();
|
$searchConditions = array();
|
||||||
@ -75,6 +77,8 @@ if ($query !== false) {
|
|||||||
"{chatthread}, {indexedchatmessage}",
|
"{chatthread}, {indexedchatmessage}",
|
||||||
array(
|
array(
|
||||||
"{indexedchatmessage}.threadid = {chatthread}.threadid",
|
"{indexedchatmessage}.threadid = {chatthread}.threadid",
|
||||||
|
"({chatthread}.invitationstate = :invitation_accepted " .
|
||||||
|
"OR {chatthread}.invitationstate = :invitation_not_invited)",
|
||||||
"(" . implode(' or ', $searchConditions) . ")"
|
"(" . implode(' or ', $searchConditions) . ")"
|
||||||
),
|
),
|
||||||
"order by {chatthread}.dtmcreated DESC",
|
"order by {chatthread}.dtmcreated DESC",
|
||||||
|
@ -40,10 +40,17 @@ function threads_by_userid($userid)
|
|||||||
}
|
}
|
||||||
|
|
||||||
return $db->query(
|
return $db->query(
|
||||||
"select {chatthread}.* " .
|
"SELECT {chatthread}.* " .
|
||||||
"from {chatthread} " .
|
"FROM {chatthread} " .
|
||||||
"where userid=? order by dtmcreated DESC",
|
"WHERE userid=:user_id " .
|
||||||
array($userid),
|
"AND (invitationstate = :invitation_accepted " .
|
||||||
|
"OR invitationstate = :invitation_not_invited) " .
|
||||||
|
"ORDER BY dtmcreated DESC",
|
||||||
|
array(
|
||||||
|
':user_id' => $userid,
|
||||||
|
':invitation_accepted' => Thread::INVITATION_ACCEPTED,
|
||||||
|
':invitation_not_invited' => Thread::INVITATION_NOT_INVITED
|
||||||
|
),
|
||||||
array('return_rows' => Database::RETURN_ALL_ROWS)
|
array('return_rows' => Database::RETURN_ALL_ROWS)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user