Browse Source

add FriendChatRoom blocked support

reviewable/pr6623/r7
Anthony Bilinski 4 years ago
parent
commit
8bef58e299
No known key found for this signature in database
GPG Key ID: 2AA8E0DA1B31FB3C
  1. 14
      src/model/chatroom/friendchatroom.cpp
  2. 3
      src/model/chatroom/friendchatroom.h

14
src/model/chatroom/friendchatroom.cpp

@ -115,6 +115,20 @@ bool FriendChatroom::autoAcceptEnabled() const @@ -115,6 +115,20 @@ bool FriendChatroom::autoAcceptEnabled() const
return getAutoAcceptDir().isEmpty();
}
bool FriendChatroom::getBlocked() const
{
return frnd->getStatus() == Status::Status::Blocked;
}
void FriendChatroom::setBlocked(bool blocked)
{
if (blocked) {
frnd->block();
} else {
frnd->unblock();
}
}
void FriendChatroom::inviteFriend(const Group* group)
{
const auto friendId = frnd->getId();

3
src/model/chatroom/friendchatroom.h

@ -72,6 +72,9 @@ public slots: @@ -72,6 +72,9 @@ public slots:
void disableAutoAccept();
void setAutoAcceptDir(const QString& dir);
bool getBlocked() const;
void setBlocked(bool blocked);
QVector<GroupToDisplay> getGroups() const;
QVector<CircleToDisplay> getOtherCircles() const;

Loading…
Cancel
Save