Browse Source

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

Fix #4018
reviewable/pr4115/r2
noavarice 9 years ago
parent
commit
034c507cc4
  1. 4
      src/widget/form/groupchatform.cpp
  2. 1
      src/widget/friendwidget.cpp
  3. 4
      src/widget/groupwidget.cpp

4
src/widget/form/groupchatform.cpp

@ -298,7 +298,9 @@ void GroupChatForm::dropEvent(QDropEvent *ev) @@ -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()

1
src/widget/friendwidget.cpp

@ -113,6 +113,7 @@ void FriendWidget::onContextMenuCalled(QContextMenuEvent *event) @@ -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;

4
src/widget/groupwidget.cpp

@ -258,7 +258,9 @@ void GroupWidget::dropEvent(QDropEvent *ev) @@ -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…
Cancel
Save