1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

fix: Now cannot send party invite to a friend which has "Offline" status

Fix #4018
This commit is contained in:
noavarice 2017-02-02 01:47:45 +03:00
parent 5c5dce4d33
commit 034c507cc4
3 changed files with 7 additions and 2 deletions

View File

@ -298,7 +298,9 @@ void GroupChatForm::dropEvent(QDropEvent *ev)
int friendId = frnd->getFriendId();
int groupId = group->getGroupId();
Core::getInstance()->groupInviteFriend(friendId, groupId);
if (frnd->getStatus() != Status::Offline) {
Core::getInstance()->groupInviteFriend(friendId, groupId);
}
}
void GroupChatForm::onMicMuteToggle()

View File

@ -113,6 +113,7 @@ void FriendWidget::onContextMenuCalled(QContextMenuEvent *event)
menu.addSeparator();
QMenu* inviteMenu = menu.addMenu(tr("Invite to group","Menu to invite a friend to a groupchat"));
inviteMenu->setEnabled(getFriend()->getStatus() != Status::Offline);
QAction* newGroupAction = inviteMenu->addAction(tr("To new group"));
inviteMenu->addSeparator();
QMap<QAction*, Group*> groupActions;

View File

@ -258,7 +258,9 @@ void GroupWidget::dropEvent(QDropEvent *ev)
return;
int friendId = frnd->getFriendId();
Core::getInstance()->groupInviteFriend(friendId, groupId);
if (frnd->getStatus() != Status::Offline) {
Core::getInstance()->groupInviteFriend(friendId, groupId);
}
if (!active)
setBackgroundRole(QPalette::Window);