mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
commit
a556762c54
|
@ -136,7 +136,7 @@ ChatForm::ChatForm(Friend* chatFriend)
|
||||||
} );
|
} );
|
||||||
|
|
||||||
setAcceptDrops(true);
|
setAcceptDrops(true);
|
||||||
|
disableCallButtons();
|
||||||
retranslateUi();
|
retranslateUi();
|
||||||
Translator::registerHandler(std::bind(&ChatForm::retranslateUi, this), this);
|
Translator::registerHandler(std::bind(&ChatForm::retranslateUi, this), this);
|
||||||
}
|
}
|
||||||
|
@ -628,10 +628,17 @@ void ChatForm::onFileSendFailed(uint32_t FriendId, const QString &fname)
|
||||||
void ChatForm::onFriendStatusChanged(uint32_t friendId, Status status)
|
void ChatForm::onFriendStatusChanged(uint32_t friendId, Status status)
|
||||||
{
|
{
|
||||||
// Disable call buttons if friend is offline
|
// Disable call buttons if friend is offline
|
||||||
if(friendId == f->getFriendID() && status == Status::Offline)
|
if(friendId != f->getFriendID())
|
||||||
|
return;
|
||||||
|
|
||||||
|
Status old = oldStatus.value(friendId, Status::Offline);
|
||||||
|
|
||||||
|
if (old != Status::Offline && status == Status::Offline)
|
||||||
disableCallButtons();
|
disableCallButtons();
|
||||||
else
|
else if (old == Status::Offline && status != Status::Offline)
|
||||||
onEnableCallButtons();
|
enableCallButtons();
|
||||||
|
|
||||||
|
oldStatus[friendId] = status;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ChatForm::onAvatarChange(uint32_t FriendId, const QPixmap &pic)
|
void ChatForm::onAvatarChange(uint32_t FriendId, const QPixmap &pic)
|
||||||
|
@ -935,12 +942,6 @@ void ChatForm::show(ContentLayout* contentLayout)
|
||||||
{
|
{
|
||||||
GenericChatForm::show(contentLayout);
|
GenericChatForm::show(contentLayout);
|
||||||
|
|
||||||
// Disable call buttons if friend is offline
|
|
||||||
if(f->getStatus() == Status::Offline)
|
|
||||||
disableCallButtons();
|
|
||||||
else
|
|
||||||
onEnableCallButtons();
|
|
||||||
|
|
||||||
if (callConfirm)
|
if (callConfirm)
|
||||||
callConfirm->show();
|
callConfirm->show();
|
||||||
}
|
}
|
||||||
|
|
|
@ -122,6 +122,7 @@ private:
|
||||||
QAction* copyStatusAction;
|
QAction* copyStatusAction;
|
||||||
|
|
||||||
QHash<uint, FileTransferInstance*> ftransWidgets;
|
QHash<uint, FileTransferInstance*> ftransWidgets;
|
||||||
|
QMap<uint32_t, Status> oldStatus;
|
||||||
CallConfirmWidget *callConfirm;
|
CallConfirmWidget *callConfirm;
|
||||||
bool isTyping;
|
bool isTyping;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue
Block a user