AnalyzeInviteLink: hacky detection of request_needed/join_request for basic chat links

This commit is contained in:
Wizou 2024-09-21 19:39:41 +02:00
parent 6cfa2a4da6
commit dcfd89c2a8
2 changed files with 3 additions and 2 deletions

2
.github/dev.yml vendored
View file

@ -1,7 +1,7 @@
pr: none pr: none
trigger: [ master ] trigger: [ master ]
name: 4.1.10-dev.$(Rev:r) name: 4.1.11-dev.$(Rev:r)
pool: pool:
vmImage: ubuntu-latest vmImage: ubuntu-latest

View file

@ -754,7 +754,8 @@ namespace WTelegram
} }
var rrAbout = ci.about == null ? null : new RestrictionReason[] { new() { text = ci.about } }; var rrAbout = ci.about == null ? null : new RestrictionReason[] { new() { text = ci.about } };
return !ci.flags.HasFlag(ChatInvite.Flags.channel) return !ci.flags.HasFlag(ChatInvite.Flags.channel)
? new Chat { title = ci.title, photo = chatPhoto, participants_count = ci.participants_count } ? new Chat { title = ci.title, photo = chatPhoto, participants_count = ci.participants_count,
flags = ci.flags.HasFlag(ChatInvite.Flags.request_needed) ? (Chat.Flags)Channel.Flags.join_request : 0 }
: new Channel { title = ci.title, photo = chatPhoto, participants_count = ci.participants_count, : new Channel { title = ci.title, photo = chatPhoto, participants_count = ci.participants_count,
restriction_reason = rrAbout, flags = Channel.Flags.min | restriction_reason = rrAbout, flags = Channel.Flags.min |
(ci.flags.HasFlag(ChatInvite.Flags.broadcast) ? Channel.Flags.broadcast : 0) | (ci.flags.HasFlag(ChatInvite.Flags.broadcast) ? Channel.Flags.broadcast : 0) |