2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Added support of admin log event of extended subscriptions.

This commit is contained in:
23rd
2024-09-03 22:05:37 +03:00
committed by John Preston
parent 19d386f977
commit e44aca06cb
4 changed files with 37 additions and 1 deletions

View File

@@ -8,6 +8,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "api/api_chat_participants.h"
#include "apiwrap.h"
#include "base/unixtime.h"
#include "boxes/add_contact_box.h" // ShowAddParticipantsError
#include "boxes/peers/add_participants_box.h" // ChatInviteForbidden
#include "data/data_changes.h"
@@ -267,8 +268,16 @@ ChatParticipant::ChatParticipant(
}, [&](const MTPDchannelParticipantSelf &data) {
_type = Type::Member;
_by = peerToUser(peerFromUser(data.vinviter_id()));
if (data.vsubscription_until_date()) {
_subscriptionDate = base::unixtime::parse(
data.vsubscription_until_date()->v);
}
}, [&](const MTPDchannelParticipant &data) {
_type = Type::Member;
if (data.vsubscription_until_date()) {
_subscriptionDate = base::unixtime::parse(
data.vsubscription_until_date()->v);
}
}, [&](const MTPDchannelParticipantBanned &data) {
_restrictions = ChatRestrictionsInfo(data.vbanned_rights());
_by = peerToUser(peerFromUser(data.vkicked_by()));
@@ -348,6 +357,10 @@ ChatAdminRightsInfo ChatParticipant::rights() const {
return _rights;
}
QDateTime ChatParticipant::subscriptionDate() const {
return _subscriptionDate;
}
ChatParticipant::Type ChatParticipant::type() const {
return _type;
}

View File

@@ -60,6 +60,8 @@ public:
ChatRestrictionsInfo restrictions() const;
ChatAdminRightsInfo rights() const;
QDateTime subscriptionDate() const;
Type type() const;
QString rank() const;
@@ -73,6 +75,7 @@ private:
bool _canBeEdited = false;
QString _rank;
QDateTime _subscriptionDate;
ChatRestrictionsInfo _restrictions;
ChatAdminRightsInfo _rights;