apps/chat/models.py
def auto_close_long_polling(self, user_token, auto_close):
        """
        close automatically chat if talker close browser or tab
        :param user_token: String
        :param auto_close: String
        """
        talker_token = str(self.get_talker_token(user_token))
        long_polling = self.get_long_polling(talker_token)
        if long_polling and self.status == self.STATUS_READY \
                and (datetime.datetime.now() - long_polling.created).seconds > auto_close:
            self.close_chat(talker_token)

        close automatically chat if talker close browser or tab
        :param user_token: String
        :param auto_close: String
        
close automatically chat if talker close browser or tab
close automatically chat if talker close browser or tab
def auto_close_long_polling(self, user_token, auto_close):
        talker_token = str(self.get_talker_token(user_token))
        long_polling = self.get_long_polling(talker_token)
        if long_polling and self.status == self.STATUS_READY \
                and (datetime.datetime.now() - long_polling.created).seconds > auto_close:
            self.close_chat(talker_token)
def auto_close_long_polling ( self , user_token , auto_close ) : talker_token = str ( self . get_talker_token ( user_token ) ) long_polling = self . get_long_polling ( talker_token ) if long_polling and self . status == self . STATUS_READY and ( datetime . datetime . now ( ) - long_polling . created ) . seconds > auto_close : self . close_chat ( talker_token )
close automatically chat if talker close browser or tab
close automatically chat if talker close browser or tab
"""
        close automatically chat if talker close browser or tab
        :param user_token: String
        :param auto_close: String
        """
self
user_token
None
auto_close
None