a
    Ùûi  ã                   @   s   d dl mZ dd„ ZdS )é   )ÚMessagec                 C   s:   | j jr2tjj| j ddd�j| j d� ¡ }d|iS ddiS )NF)Zchat__participantsÚis_readÚ
is_deleted)ÚsenderZunread_messages_counté    )ÚuserÚis_authenticatedr   ÚobjectsÚfilterÚexcludeÚcount)ÚrequestZunread© r   ú,D:\diplom_project\chat\context_processors.pyÚunread_count   s    ýü
r   N)Úmodelsr   r   r   r   r   r   Ú<module>   s   