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:
parent
5c5dce4d33
commit
034c507cc4
|
@ -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()
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue
Block a user