Skip to content

Commit

Permalink
Added helpers Message.ReplyHeader .TopicID. Fix duplicate pinned in C…
Browse files Browse the repository at this point in the history
…hannels_GetAllForumTopics
  • Loading branch information
wiz0u committed Nov 2, 2024
1 parent 33dd2d0 commit f1c1d0a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Client.Helpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,7 @@ public async Task<Channels_AdminLogResults> Channels_GetAdminLog(InputChannelBas
/// <param name="q">Search query</param>
public async Task<Messages_ForumTopics> Channels_GetAllForumTopics(InputChannelBase channel, string q = null)
{
var result = await this.Channels_GetForumTopics(channel, limit: 20, q: q);
var result = await this.Channels_GetForumTopics(channel, offset_date: DateTime.MaxValue, q: q);
if (result.topics.Length < result.count)
{
var topics = result.topics.ToList();
Expand Down
6 changes: 4 additions & 2 deletions src/TL.Xtended.cs
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@ partial class ChatParticipantsBase { public abstract ChatParticipantBase[] Part
partial class ChatParticipantsForbidden { public override ChatParticipantBase[] Participants => []; }
partial class ChatParticipants { public override ChatParticipantBase[] Participants => participants; }

partial class MessageBase { public MessageReplyHeader ReplyHeader => ReplyTo as MessageReplyHeader; }
partial class MessageEmpty { public override string ToString() => "(no message)"; }
partial class Message { public override string ToString() => $"{(from_id ?? peer_id)?.ID}> {message} {media}"; }
partial class MessageService { public override string ToString() => $"{(from_id ?? peer_id)?.ID} [{action.GetType().Name[13..]}]"; }
Expand Down Expand Up @@ -756,8 +757,9 @@ public override object ToNative()
}
}

partial class Theme { public static implicit operator InputTheme(Theme theme) => new() { id = theme.id, access_hash = theme.access_hash }; }
partial class GroupCallBase { public static implicit operator InputGroupCall(GroupCallBase call) => new() { id = call.ID, access_hash = call.AccessHash }; }
partial class Theme { public static implicit operator InputTheme(Theme theme) => new() { id = theme.id, access_hash = theme.access_hash }; }
partial class MessageReplyHeader { public int TopicID => flags.HasFlag(Flags.forum_topic) ? flags.HasFlag(Flags.has_reply_to_top_id) ? reply_to_top_id : reply_to_msg_id : 0; }
partial class GroupCallBase { public static implicit operator InputGroupCall(GroupCallBase call) => new() { id = call.ID, access_hash = call.AccessHash }; }

partial class RequestedPeer { public abstract long ID { get; } }
partial class RequestedPeerUser { public override long ID => user_id; }
Expand Down

0 comments on commit f1c1d0a

Please sign in to comment.