diff --git a/src/widget/form/groupchatform.cpp b/src/widget/form/groupchatform.cpp index 7eb4c2557e..0d065ff52b 100644 --- a/src/widget/form/groupchatform.cpp +++ b/src/widget/form/groupchatform.cpp @@ -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() diff --git a/src/widget/friendwidget.cpp b/src/widget/friendwidget.cpp index 9ec6997b7d..d68e69679c 100644 --- a/src/widget/friendwidget.cpp +++ b/src/widget/friendwidget.cpp @@ -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 groupActions; diff --git a/src/widget/groupwidget.cpp b/src/widget/groupwidget.cpp index 7529905364..b2cf0a035e 100644 --- a/src/widget/groupwidget.cpp +++ b/src/widget/groupwidget.cpp @@ -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);