Skip to content
This repository has been archived by the owner on Feb 12, 2023. It is now read-only.

Commit

Permalink
fix: Now cannot send party invite to a friend which has "Offline" status
Browse files Browse the repository at this point in the history
Fix #4018
  • Loading branch information
noavarice committed Feb 3, 2017
1 parent 5c5dce4 commit 034c507
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/widget/form/groupchatform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
1 change: 1 addition & 0 deletions src/widget/friendwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 3 additions & 1 deletion src/widget/groupwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 034c507

Please sign in to comment.