mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-03 21:43:21 +00:00 
			
		
		
		
	sent_by_human: Add "test suite" to the set of Zulip UI-style clients.
Earlier, when we used 'self.send_message()' in the backend tests, the sent message was not marked as read for the sender. Reason: To set the read flag, we have to check if 'message.sent_by_human()'. It returns False because the 'sending_client' for tests is "test suite" and the 'sent_by_human' function doesn't enlist the "test suite" client name as a human client. This commit adds "test suite" to that list. Also fixes a bug in when apply_unread_message_event was called that was revealed by this change.
This commit is contained in:
		
				
					committed by
					
						
						Tim Abbott
					
				
			
			
				
	
			
			
			
						parent
						
							68abc6af21
						
					
				
				
					commit
					c349d1137c
				
			@@ -718,7 +718,7 @@ def apply_event(
 | 
			
		||||
) -> None:
 | 
			
		||||
    if event["type"] == "message":
 | 
			
		||||
        state["max_message_id"] = max(state["max_message_id"], event["message"]["id"])
 | 
			
		||||
        if "raw_unread_msgs" in state:
 | 
			
		||||
        if "raw_unread_msgs" in state and "read" not in event["flags"]:
 | 
			
		||||
            apply_unread_message_event(
 | 
			
		||||
                user_profile,
 | 
			
		||||
                state["raw_unread_msgs"],
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user