Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ff0e515361 | ||
|
|
bece15eaac |
2
.github/workflows/mac.yml
vendored
2
.github/workflows/mac.yml
vendored
@@ -97,7 +97,7 @@ jobs:
|
||||
./$REPO_NAME/Telegram/build/prepare/mac.sh skip-release silent
|
||||
|
||||
- name: Free up some disk space.
|
||||
run: find Libraries '(' '(' ! '(' -name '*.a' -o -name '*.h' -o -name '*.hpp' -o -name '*.inc' -o -name '*.cmake' -o -path '*/include/*' -o -path '*/objects-*' -o -path '*/cache_keys/*' -o -perm +111 ')' -type f ')' -o -empty ')' -delete
|
||||
run: find Libraries '(' '(' ! '(' -name '*.a' -o -name '*.h' -o -name '*.hpp' -o -name '*.inc' -o -name '*.cmake' -o -path '*/include/*' -o -path '*/objects-*' -o -path '*/cache_keys/*' -o -path '*/patches/*' -o -perm +111 ')' -type f ')' -o -empty ')' -delete
|
||||
|
||||
- name: Telegram Desktop build.
|
||||
if: env.ONLY_CACHE == 'false'
|
||||
|
||||
2
.github/workflows/win.yml
vendored
2
.github/workflows/win.yml
vendored
@@ -175,7 +175,7 @@ jobs:
|
||||
|
||||
- name: Free up some disk space.
|
||||
shell: bash
|
||||
run: find TBuild/Libraries '(' '(' ! '(' -name '*.lib' -o -name '*.a' -o -name '*.exe' -o -name '*.h' -o -name '*.hpp' -o -name '*.inc' -o -name '*.cmake' -o -path '*/include/*' -o -path '*/objects-*' -o -path '*/cache_keys/*' ')' -type f ')' -o -empty ')' -delete
|
||||
run: find TBuild/Libraries '(' '(' ! '(' -name '*.lib' -o -name '*.a' -o -name '*.exe' -o -name '*.h' -o -name '*.hpp' -o -name '*.inc' -o -name '*.cmake' -o -path '*/include/*' -o -path '*/objects-*' -o -path '*/cache_keys/*' -o -path '*/patches/*' ')' -type f ')' -o -empty ')' -delete
|
||||
|
||||
- name: Telegram Desktop build.
|
||||
if: env.ONLY_CACHE == 'false'
|
||||
|
||||
@@ -1902,6 +1902,9 @@ void ParticipantsBoxController::editRestrictedDone(
|
||||
|
||||
void ParticipantsBoxController::kickParticipant(not_null<PeerData*> participant) {
|
||||
const auto user = participant->asUser();
|
||||
if (user && user->isInaccessible()) {
|
||||
return kickParticipantSure(participant);
|
||||
}
|
||||
const auto text = ((_peer->isChat() || _peer->isMegagroup())
|
||||
? tr::lng_profile_sure_kick
|
||||
: tr::lng_profile_sure_kick_channel)(
|
||||
@@ -2128,7 +2131,12 @@ auto ParticipantsBoxController::computeType(
|
||||
: (user && _additional.adminRights(user).has_value())
|
||||
? Rights::Admin
|
||||
: Rights::Normal;
|
||||
result.adminRank = user ? _additional.adminRank(user) : QString();
|
||||
result.canRemove = _additional.canRemoveParticipant(participant)
|
||||
&& user
|
||||
&& user->isInaccessible();
|
||||
if (!result.canRemove) {
|
||||
result.adminRank = user ? _additional.adminRank(user) : QString();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@@ -30,7 +30,9 @@ MemberListRow::MemberListRow(
|
||||
|
||||
void MemberListRow::setType(Type type) {
|
||||
_type = type;
|
||||
PeerListRowWithLink::setActionLink(!_type.adminRank.isEmpty()
|
||||
PeerListRowWithLink::setActionLink(_type.canRemove
|
||||
? tr::lng_profile_delete_removed(tr::now)
|
||||
: !_type.adminRank.isEmpty()
|
||||
? _type.adminRank
|
||||
: (_type.rights == Rights::Creator)
|
||||
? tr::lng_owner_badge(tr::now)
|
||||
@@ -44,11 +46,19 @@ MemberListRow::Type MemberListRow::type() const {
|
||||
}
|
||||
|
||||
bool MemberListRow::rightActionDisabled() const {
|
||||
return true;
|
||||
return !canRemove();
|
||||
}
|
||||
|
||||
QMargins MemberListRow::rightActionMargins() const {
|
||||
const auto skip = st::contactsCheckPosition.x();
|
||||
if (canRemove()) {
|
||||
const auto &st = st::defaultPeerListItem;
|
||||
return QMargins(
|
||||
skip,
|
||||
(st.height - st.nameStyle.font->height) / 2,
|
||||
st.photoPosition.x() + skip,
|
||||
0);
|
||||
}
|
||||
return QMargins(
|
||||
skip,
|
||||
st::defaultPeerListItem.namePosition.y(),
|
||||
@@ -72,6 +82,10 @@ void MemberListRow::refreshStatus() {
|
||||
}
|
||||
}
|
||||
|
||||
bool MemberListRow::canRemove() const {
|
||||
return _type.canRemove;
|
||||
}
|
||||
|
||||
std::unique_ptr<ParticipantsBoxController> CreateMembersController(
|
||||
not_null<Window::SessionNavigation*> navigation,
|
||||
not_null<PeerData*> peer) {
|
||||
|
||||
@@ -28,6 +28,7 @@ public:
|
||||
};
|
||||
struct Type {
|
||||
Rights rights;
|
||||
bool canRemove = false;
|
||||
QString adminRank;
|
||||
};
|
||||
|
||||
@@ -42,6 +43,7 @@ public:
|
||||
not_null<UserData*> user() const;
|
||||
|
||||
private:
|
||||
[[nodiscard]] bool canRemove() const;
|
||||
Type _type;
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user