public void SaveMessage() { var message = _editedMessage as TLMessage34; if (message == null) { return; } var inputPeer = With as IInputPeer; if (inputPeer == null) { return; } var text = GetTrimmedText(Text) ?? string.Empty; //check maximum message length if (text.Length > Constants.MaximumMessageLength) { MessageBox.Show(String.Format(AppResources.MaximumMessageLengthExceeded, Constants.MaximumMessageLength), AppResources.Error, MessageBoxButton.OK); return; } var noWebPage = true; if (Reply != null && IsWebPagePreview(Reply)) { message._media = ((TLMessagesContainter)Reply).WebPageMedia; Reply = null; noWebPage = false; } string processedText; var entities = GetEntities(text, out processedText); TLVector <TLMessageEntityBase> entitiesVector = null; if (entities != null) { var message48 = message as TLMessage48; if (message48 != null) { entitiesVector = new TLVector <TLMessageEntityBase>(entities); message48.Entities = entitiesVector; } } IsWorking = true; MTProtoService.EditMessageAsync(inputPeer.ToInputPeer(), message.Id, new TLString(processedText), entitiesVector, null, null, noWebPage, false, null, result => Execute.BeginOnUIThread(() => { IsWorking = false; var message48 = message as TLMessage48; if (message48 != null) { message48.NotifyOfPropertyChange(() => message48.EditDate); message48.NotifyOfPropertyChange(() => message48.EditDateVisibility); } StopEditMessage(); }), error => Execute.BeginOnUIThread(() => { IsWorking = false; if (error.CodeEquals(ErrorCode.BAD_REQUEST)) { if (error.TypeEquals(ErrorType.MESSAGE_ID_INVALID)) { MessageBox.Show(AppResources.EditMessageError, AppResources.Error, MessageBoxButton.OK); } if (error.TypeEquals(ErrorType.MESSAGE_NOT_MODIFIED)) { } StopEditMessage(); } Telegram.Api.Helpers.Execute.ShowDebugMessage("channel.getMessageEditData error " + error); })); }