public void UpdateMessage(MessageViewModel message)
        {
            _message = message;

            var sticker = GetContent(message);

            if (sticker == null)
            {
                return;
            }

            if (message.Content is MessageText text)
            {
                Width  = Player.Width = 200 * message.ProtoService.Config.GetNamedNumber("emojies_animated_zoom", 0.625);
                Height = Player.Height = 200 * message.ProtoService.Config.GetNamedNumber("emojies_animated_zoom", 0.625);
                Player.ColorReplacements = Emoji.GetColorReplacements(text.Text.Text);
            }
            else
            {
                Width  = Player.Width = 200;
                Height = Player.Height = 200;
                Player.ColorReplacements = null;
            }

            if (sticker.Thumbnail != null && !sticker.StickerValue.Local.IsDownloadingCompleted)
            {
                UpdateThumbnail(message, sticker.Thumbnail.File);
            }

            UpdateFile(message, sticker.StickerValue);
        }
Exemple #2
0
        public void UpdateMessage(MessageViewModel message)
        {
            _message = message;

            var sticker = GetContent(message);

            if (sticker == null || !_templateApplied)
            {
                return;
            }

            if (message.Content is MessageText text)
            {
                Width  = Player.Width = 200 * message.ProtoService.Config.GetNamedNumber("emojies_animated_zoom", 0.625f);
                Height = Player.Height = 200 * message.ProtoService.Config.GetNamedNumber("emojies_animated_zoom", 0.625f);
                Player.ColorReplacements = Emoji.GetColorReplacements(text.Text.Text);

                var sound = message.ProtoService.GetEmojiSound(sticker.Emoji);
                if (sound != null && sound.Local.CanBeDownloaded && !sound.Local.IsDownloadingActive)
                {
                    message.ProtoService.DownloadFile(sound.Id, 1);
                }
            }
            else
            {
                Width  = Player.Width = 200;
                Height = Player.Height = 200;
                Player.ColorReplacements = null;
            }

            if (!sticker.StickerValue.Local.IsDownloadingCompleted)
            {
                UpdateThumbnail(message, sticker.Outline);
            }

            UpdateFile(message, sticker.StickerValue);
        }