mirror of
				https://github.com/Mibew/design.git
				synced 2025-10-31 18:41:05 +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; | ||||
| 
 | ||||
| 	$values = array( | ||||
| 		':query' => "%{$query}%" | ||||
| 		':query' => "%{$query}%", | ||||
| 		':invitation_accepted' => Thread::INVITATION_ACCEPTED, | ||||
| 		':invitation_not_invited' => Thread::INVITATION_NOT_INVITED | ||||
| 	); | ||||
| 
 | ||||
| 	$searchConditions = array(); | ||||
| @ -75,6 +77,8 @@ if ($query !== false) { | ||||
| 		"{chatthread}, {indexedchatmessage}", | ||||
| 		array( | ||||
| 			"{indexedchatmessage}.threadid = {chatthread}.threadid", | ||||
| 			"({chatthread}.invitationstate = :invitation_accepted " . | ||||
| 				"OR {chatthread}.invitationstate = :invitation_not_invited)", | ||||
| 			"(" . implode(' or ', $searchConditions)  .  ")" | ||||
| 		), | ||||
| 		"order by {chatthread}.dtmcreated DESC", | ||||
|  | ||||
| @ -40,10 +40,17 @@ function threads_by_userid($userid) | ||||
| 	} | ||||
| 
 | ||||
| 	return $db->query( | ||||
| 		"select {chatthread}.* " . | ||||
| 		"from {chatthread} " . | ||||
| 		"where userid=? order by dtmcreated DESC", | ||||
| 		array($userid), | ||||
| 		"SELECT {chatthread}.* " . | ||||
| 		"FROM {chatthread} " . | ||||
| 		"WHERE userid=:user_id " . | ||||
| 			"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) | ||||
| 	); | ||||
| } | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user