1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00
This commit is contained in:
Dubslow 2015-02-10 22:43:25 -06:00
parent 6cbc5ab87c
commit 0164b53aba
No known key found for this signature in database
GPG Key ID: 3DB8E05315C220AA
2 changed files with 16 additions and 7 deletions

View File

@ -156,16 +156,24 @@ void ChatForm::onSendTriggered()
void ChatForm::onTextEditChanged() void ChatForm::onTextEditChanged()
{ {
bool isNowTyping;
if (!Settings::getInstance().isTypingNotificationEnabled()) if (!Settings::getInstance().isTypingNotificationEnabled())
isNowTyping = false; {
else if (isTyping)
isNowTyping = msgEdit->toPlainText().length() > 0; Core::getInstance()->sendTyping(f->getFriendID(), false);
isTyping = false;
return;
}
if (isNowTyping) if (msgEdit->toPlainText().length() > 0)
{
typingTimer.start(3000); typingTimer.start(3000);
if (!isTyping)
Core::getInstance()->sendTyping(f->getFriendID(), isNowTyping); Core::getInstance()->sendTyping(f->getFriendID(), (isTyping = true));
}
else
{
Core::getInstance()->sendTyping(f->getFriendID(), (isTyping = false));
}
} }
void ChatForm::onAttachClicked() void ChatForm::onAttachClicked()

View File

@ -122,6 +122,7 @@ private:
QString secondsToDHMS(quint32 duration); QString secondsToDHMS(quint32 duration);
CallConfirmWidget *callConfirm; CallConfirmWidget *callConfirm;
void enableCallButtons(); void enableCallButtons();
bool isTyping;
}; };
#endif // CHATFORM_H #endif // CHATFORM_H