Skip to content

Commit

Permalink
AnalyzeInviteLink: hacky detection of request_needed/join_request for…
Browse files Browse the repository at this point in the history
… basic chat links
  • Loading branch information
wiz0u committed Sep 21, 2024
1 parent 6cfa2a4 commit dcfd89c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/dev.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
pr: none
trigger: [ master ]

name: 4.1.10-dev.$(Rev:r)
name: 4.1.11-dev.$(Rev:r)

pool:
vmImage: ubuntu-latest
Expand Down
3 changes: 2 additions & 1 deletion src/Client.Helpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,8 @@ public async Task<ChatBase> AnalyzeInviteLink(string url, bool join = false, IDi
}
var rrAbout = ci.about == null ? null : new RestrictionReason[] { new() { text = ci.about } };
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,
restriction_reason = rrAbout, flags = Channel.Flags.min |
(ci.flags.HasFlag(ChatInvite.Flags.broadcast) ? Channel.Flags.broadcast : 0) |
Expand Down

0 comments on commit dcfd89c

Please sign in to comment.