diff --git a/src/Client.Helpers.cs b/src/Client.Helpers.cs index c5891a5..d252370 100644 --- a/src/Client.Helpers.cs +++ b/src/Client.Helpers.cs @@ -288,11 +288,11 @@ async Task UploadFromUrl(string url) /// Destination peer /// Destination forum topic /// The resulting forwarded messages, as received by Telegram - public async Task 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 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().Count()]; var result = new Message[msgIds.Length]; foreach (var update in updates.UpdateList) diff --git a/src/Client.cs b/src/Client.cs index 04ec435..97602c7 100644 --- a/src/Client.cs +++ b/src/Client.cs @@ -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 {