Skip to content

Commit

Permalink
Fix MTProxy broken since HTTP support
Browse files Browse the repository at this point in the history
  • Loading branch information
wiz0u committed Oct 24, 2024
1 parent 9a4643e commit cb8bcb5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/Client.Helpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -288,11 +288,11 @@ async Task<InputFileBase> UploadFromUrl(string url)
/// <param name="to_peer">Destination peer</param>
/// <param name="top_msg_id">Destination <a href="https://corefork.telegram.org/api/forum#forum-topics">forum topic</a></param>
/// <returns>The resulting forwarded messages, as received by Telegram</returns>
public async Task<Message[]> ForwardMessagesAsync(InputPeer from_peer, int[] msg_ids, InputPeer to_peer, int? top_msg_id = null, bool drop_author = false, bool drop_media_captions = false)
public async Task<Message[]> ForwardMessagesAsync(InputPeer from_peer, int[] msg_ids, InputPeer to_peer, int top_msg_id = 0, bool drop_author = false, bool drop_media_captions = false)
{
var random_id = Helpers.RandomLong();
var random_ids = Enumerable.Range(0, msg_ids.Length).Select(i => random_id + i).ToArray();
var updates = await this.Messages_ForwardMessages(from_peer, msg_ids, random_ids, to_peer, top_msg_id, drop_author: drop_author, drop_media_captions: drop_media_captions);
var updates = await this.Messages_ForwardMessages(from_peer, msg_ids, random_ids, to_peer, top_msg_id == 0 ? null : top_msg_id, drop_author: drop_author, drop_media_captions: drop_media_captions);
var msgIds = new int[updates.UpdateList.OfType<UpdateMessageID>().Count()];
var result = new Message[msgIds.Length];
foreach (var update in updates.UpdateList)
Expand Down
2 changes: 1 addition & 1 deletion src/Client.cs
Original file line number Diff line number Diff line change
Expand Up @@ -884,7 +884,7 @@ private async Task DoConnectAsync(bool quickResume)
throw new Exception("Library was not compiled with OBFUSCATION symbol");
#endif
}
if (_httpClient != null)
else if (_httpClient != null)
_reactorTask = Task.CompletedTask;
else
{
Expand Down

0 comments on commit cb8bcb5

Please sign in to comment.