gui: check for show "is typing" before time call

This commit is contained in:
chelovechishko 2018-07-04 00:34:45 +09:00
parent b950e12bcf
commit 77c3eae976

View File

@ -1165,12 +1165,13 @@ void ChatWidget::resetStatusBar()
void ChatWidget::updateStatusTyping()
{
if(Settings->getChatDoNotSendIsTyping())
return;
if (time(NULL) - lastStatusSendTime > 5) // limit 'peer is typing' packets to at most every 10 sec
{
#ifdef ONLY_FOR_LINGUIST
tr("is typing...");
#endif
if(!Settings->getChatDoNotSendIsTyping())
rsMsgs->sendStatusString(chatId, "is typing...");
lastStatusSendTime = time(NULL) ;
}