From 82d2dce0ac3b6034d8d0ce47626905b48c85c730 Mon Sep 17 00:00:00 2001 From: javitosanchez Date: Thu, 8 Sep 2016 11:48:08 +0200 Subject: [PATCH 1/4] Add ImageFailed event to ImageEx --- src/AppStudio.Uwp/AppStudio.Uwp.csproj | 1 + .../Controls/ImageEx/ImageEx.Members.cs | 4 + .../Controls/ImageEx/ImageEx.Source.cs | 533 +++++++++--------- .../EventArguments/SourceEventArgs.cs | 17 + 4 files changed, 290 insertions(+), 265 deletions(-) create mode 100644 src/AppStudio.Uwp/EventArguments/SourceEventArgs.cs diff --git a/src/AppStudio.Uwp/AppStudio.Uwp.csproj b/src/AppStudio.Uwp/AppStudio.Uwp.csproj index fc7646c4..e946bc6c 100644 --- a/src/AppStudio.Uwp/AppStudio.Uwp.csproj +++ b/src/AppStudio.Uwp/AppStudio.Uwp.csproj @@ -187,6 +187,7 @@ + diff --git a/src/AppStudio.Uwp/Controls/ImageEx/ImageEx.Members.cs b/src/AppStudio.Uwp/Controls/ImageEx/ImageEx.Members.cs index 7b2c5be3..40bf4493 100644 --- a/src/AppStudio.Uwp/Controls/ImageEx/ImageEx.Members.cs +++ b/src/AppStudio.Uwp/Controls/ImageEx/ImageEx.Members.cs @@ -2,11 +2,15 @@ using Windows.UI.Xaml.Media; using Windows.UI.Xaml.Controls; using Windows.Media.Casting; +using System; +using AppStudio.Uwp.EventArguments; namespace AppStudio.Uwp.Controls { partial class ImageEx { + public event EventHandler ImageFailed; + #region Stretch public Stretch Stretch { diff --git a/src/AppStudio.Uwp/Controls/ImageEx/ImageEx.Source.cs b/src/AppStudio.Uwp/Controls/ImageEx/ImageEx.Source.cs index 8ab18edc..7989e307 100644 --- a/src/AppStudio.Uwp/Controls/ImageEx/ImageEx.Source.cs +++ b/src/AppStudio.Uwp/Controls/ImageEx/ImageEx.Source.cs @@ -1,265 +1,268 @@ -using System; -using System.IO; - -using Windows.UI.Xaml; -using Windows.UI.Xaml.Data; -using Windows.UI.Xaml.Media; -using Windows.UI.Xaml.Controls; -using Windows.UI.Xaml.Media.Imaging; - -namespace AppStudio.Uwp.Controls -{ - partial class ImageEx - { - private bool _isHttpSource = false; - - #region Source - public object Source - { - get { return (object)GetValue(SourceProperty); } - set { SetValue(SourceProperty, value); } - } - - private static void SourceChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) - { - var control = d as ImageEx; - control.SetSource(e.NewValue); - } - - public static readonly DependencyProperty SourceProperty = DependencyProperty.Register("Source", typeof(object), typeof(ImageEx), new PropertyMetadata(null, SourceChanged)); - #endregion - - #region SetSource - private void SetSource(object source) - { - _isHttpSource = false; - if (source != null) - { - string url = source as String; - if (url != null) - { - SetSourceString(url); - } - else - { - Uri uri = source as Uri; - if (uri != null) - { - SetSourceUri(uri); - } - else - { - ImageSource imageSource = source as ImageSource; - if (imageSource != null) - { - SetImage(imageSource); - } - else - { - ClearImage(); - ClearImageGif(); - } - } - } - } - else - { - ClearImage(); - ClearImageGif(); - } - } - - private void SetSourceString(string url) - { - Uri uri = null; - if (Uri.TryCreate(url, UriKind.Absolute, out uri)) - { - SetSourceUri(uri); - } - else if (Uri.IsWellFormedUriString(url, UriKind.Relative)) - { - if (Uri.TryCreate("ms-appx:///" + url.TrimStart('/'), UriKind.Absolute, out uri)) - { - SetSourceUri(uri); - } - else - { - ClearImage(); - ClearImageGif(); - } - } - else - { - ClearImage(); - ClearImageGif(); - } - } - - private Uri _currentUri = null; - - private async void SetSourceUri(Uri uri) - { - _currentUri = uri; - try - { - if (uri.IsAbsoluteUri) - { - var cachedUri = uri; - if (uri.Scheme == "http" || uri.Scheme == "https") - { - SetProgress(); - _isHttpSource = true; - if (!Windows.ApplicationModel.DesignMode.DesignModeEnabled) - { - cachedUri = await BitmapCache.GetImageUriAsync(uri, (int)_currentSize.Width, (int)_currentSize.Height); - if (cachedUri == null) - { - ClearProgress(); - ClearImage(); - ClearImageGif(); - return; - } - } - } - if (Path.GetExtension(uri.LocalPath).Equals(".gif", StringComparison.OrdinalIgnoreCase)) - { - this.SetImageGif(cachedUri); - } - else - { - this.SetImage(new BitmapImage(cachedUri)); - } - } - else - { - ClearImage(); - ClearImageGif(); - } - } - catch - { - // Invalid Uri - ClearImage(); - ClearImageGif(); - } - } - #endregion - - private async void RefreshSourceUri(Uri uri) - { - try - { - if (!Windows.ApplicationModel.DesignMode.DesignModeEnabled) - { - uri = await BitmapCache.GetImageUriAsync(uri, (int)_currentSize.Width, (int)_currentSize.Height); - } - if (uri != null) - { - this.SetImage(new BitmapImage(uri)); - } - } - catch (Exception ex) - { - System.Diagnostics.Debug.WriteLine("RefreshSourceUri. {0}", ex.Message); - } - } - - private static int _progressCount = 0; - private object _progressCountLock = new object(); - - private void SetProgress() - { - if (this.Progress != null) - { - return; - } - - bool available = false; - - lock (_progressCountLock) - { - if (_progressCount < 100) - { - _progressCount++; - available = true; - } - } - - if (available) - { - var progress = new ProgressRing - { - IsActive = true - }; - progress.SetBinding(ProgressRing.BackgroundProperty, new Binding { Source = this, Path = new PropertyPath("Background") }); - progress.SetBinding(ProgressRing.ForegroundProperty, new Binding { Source = this, Path = new PropertyPath("Foreground") }); - this.Content = progress; - } - } - - private void SetImage(ImageSource imageSource) - { - ClearProgress(); - ClearImageGif(); - - var image = this.Image; - if (image == null) - { - image = new Image(); - image.SetBinding(Image.StretchProperty, new Binding { Source = this, Path = new PropertyPath("Stretch") }); - image.SetBinding(Image.HorizontalAlignmentProperty, new Binding { Source = this, Path = new PropertyPath("HorizontalAlignment") }); - image.SetBinding(Image.VerticalAlignmentProperty, new Binding { Source = this, Path = new PropertyPath("VerticalAlignment") }); - image.SetBinding(Image.NineGridProperty, new Binding { Source = this, Path = new PropertyPath("NineGrid") }); - this.Content = image; - } - image.Source = imageSource; - } - - private void SetImageGif(Uri uri) - { - ClearProgress(); - ClearImage(); - ClearImageGif(); - - var imageGif = new GifControl(); - imageGif.SetBinding(GifControl.StretchProperty, new Binding { Source = this, Path = new PropertyPath("Stretch") }); - imageGif.SetBinding(GifControl.HorizontalAlignmentProperty, new Binding { Source = this, Path = new PropertyPath("HorizontalAlignment") }); - imageGif.SetBinding(GifControl.VerticalAlignmentProperty, new Binding { Source = this, Path = new PropertyPath("VerticalAlignment") }); - imageGif.SetBinding(GifControl.NineGridProperty, new Binding { Source = this, Path = new PropertyPath("NineGrid") }); - imageGif.SetBinding(GifControl.AutoPlayProperty, new Binding { Source = this, Path = new PropertyPath("AnimateGif") }); - imageGif.Source = uri; - this.Content = imageGif; - } - - private void ClearProgress() - { - if (this.Progress != null) - { - this.Progress.IsActive = false; - this.Content = null; - lock (_progressCountLock) - { - _progressCount--; - } - } - } - - private void ClearImage() - { - if (this.Image != null) - { - this.Image.Source = null; - this.Content = null; - } - } - - private void ClearImageGif() - { - if (this.ImageGif != null) - { - this.ImageGif.Source = null; - this.Content = null; - } - } - } -} +using System; +using System.IO; + +using Windows.UI.Xaml; +using Windows.UI.Xaml.Data; +using Windows.UI.Xaml.Media; +using Windows.UI.Xaml.Controls; +using Windows.UI.Xaml.Media.Imaging; +using AppStudio.Uwp.EventArguments; + +namespace AppStudio.Uwp.Controls +{ + partial class ImageEx + { + private bool _isHttpSource = false; + + #region Source + public object Source + { + get { return (object)GetValue(SourceProperty); } + set { SetValue(SourceProperty, value); } + } + + private static void SourceChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) + { + var control = d as ImageEx; + control.SetSource(e.NewValue); + } + + public static readonly DependencyProperty SourceProperty = DependencyProperty.Register("Source", typeof(object), typeof(ImageEx), new PropertyMetadata(null, SourceChanged)); + #endregion + + #region SetSource + private void SetSource(object source) + { + _isHttpSource = false; + if (source != null) + { + string url = source as String; + if (url != null) + { + SetSourceString(url); + } + else + { + Uri uri = source as Uri; + if (uri != null) + { + SetSourceUri(uri); + } + else + { + ImageSource imageSource = source as ImageSource; + if (imageSource != null) + { + SetImage(imageSource); + } + else + { + ClearImage(); + ClearImageGif(); + } + } + } + } + else + { + ClearImage(); + ClearImageGif(); + } + } + + private void SetSourceString(string url) + { + Uri uri = null; + if (Uri.TryCreate(url, UriKind.Absolute, out uri)) + { + SetSourceUri(uri); + } + else if (Uri.IsWellFormedUriString(url, UriKind.Relative)) + { + if (Uri.TryCreate("ms-appx:///" + url.TrimStart('/'), UriKind.Absolute, out uri)) + { + SetSourceUri(uri); + } + else + { + ClearImage(); + ClearImageGif(); + } + } + else + { + ClearImage(); + ClearImageGif(); + } + } + + private Uri _currentUri = null; + + private async void SetSourceUri(Uri uri) + { + _currentUri = uri; + try + { + if (uri.IsAbsoluteUri) + { + var cachedUri = uri; + if (uri.Scheme == "http" || uri.Scheme == "https") + { + SetProgress(); + _isHttpSource = true; + if (!Windows.ApplicationModel.DesignMode.DesignModeEnabled) + { + cachedUri = await BitmapCache.GetImageUriAsync(uri, (int)_currentSize.Width, (int)_currentSize.Height); + if (cachedUri == null) + { + ClearProgress(); + ClearImage(); + ClearImageGif(); + + ImageFailed?.Invoke(this, new SourceEventArgs(uri.ToString())); + return; + } + } + } + if (Path.GetExtension(uri.LocalPath).Equals(".gif", StringComparison.OrdinalIgnoreCase)) + { + this.SetImageGif(cachedUri); + } + else + { + this.SetImage(new BitmapImage(cachedUri)); + } + } + else + { + ClearImage(); + ClearImageGif(); + } + } + catch + { + // Invalid Uri + ClearImage(); + ClearImageGif(); + } + } + #endregion + + private async void RefreshSourceUri(Uri uri) + { + try + { + if (!Windows.ApplicationModel.DesignMode.DesignModeEnabled) + { + uri = await BitmapCache.GetImageUriAsync(uri, (int)_currentSize.Width, (int)_currentSize.Height); + } + if (uri != null) + { + this.SetImage(new BitmapImage(uri)); + } + } + catch (Exception ex) + { + System.Diagnostics.Debug.WriteLine("RefreshSourceUri. {0}", ex.Message); + } + } + + private static int _progressCount = 0; + private object _progressCountLock = new object(); + + private void SetProgress() + { + if (this.Progress != null) + { + return; + } + + bool available = false; + + lock (_progressCountLock) + { + if (_progressCount < 100) + { + _progressCount++; + available = true; + } + } + + if (available) + { + var progress = new ProgressRing + { + IsActive = true + }; + progress.SetBinding(ProgressRing.BackgroundProperty, new Binding { Source = this, Path = new PropertyPath("Background") }); + progress.SetBinding(ProgressRing.ForegroundProperty, new Binding { Source = this, Path = new PropertyPath("Foreground") }); + this.Content = progress; + } + } + + private void SetImage(ImageSource imageSource) + { + ClearProgress(); + ClearImageGif(); + + var image = this.Image; + if (image == null) + { + image = new Image(); + image.SetBinding(Image.StretchProperty, new Binding { Source = this, Path = new PropertyPath("Stretch") }); + image.SetBinding(Image.HorizontalAlignmentProperty, new Binding { Source = this, Path = new PropertyPath("HorizontalAlignment") }); + image.SetBinding(Image.VerticalAlignmentProperty, new Binding { Source = this, Path = new PropertyPath("VerticalAlignment") }); + image.SetBinding(Image.NineGridProperty, new Binding { Source = this, Path = new PropertyPath("NineGrid") }); + this.Content = image; + } + image.Source = imageSource; + } + + private void SetImageGif(Uri uri) + { + ClearProgress(); + ClearImage(); + ClearImageGif(); + + var imageGif = new GifControl(); + imageGif.SetBinding(GifControl.StretchProperty, new Binding { Source = this, Path = new PropertyPath("Stretch") }); + imageGif.SetBinding(GifControl.HorizontalAlignmentProperty, new Binding { Source = this, Path = new PropertyPath("HorizontalAlignment") }); + imageGif.SetBinding(GifControl.VerticalAlignmentProperty, new Binding { Source = this, Path = new PropertyPath("VerticalAlignment") }); + imageGif.SetBinding(GifControl.NineGridProperty, new Binding { Source = this, Path = new PropertyPath("NineGrid") }); + imageGif.SetBinding(GifControl.AutoPlayProperty, new Binding { Source = this, Path = new PropertyPath("AnimateGif") }); + imageGif.Source = uri; + this.Content = imageGif; + } + + private void ClearProgress() + { + if (this.Progress != null) + { + this.Progress.IsActive = false; + this.Content = null; + lock (_progressCountLock) + { + _progressCount--; + } + } + } + + private void ClearImage() + { + if (this.Image != null) + { + this.Image.Source = null; + this.Content = null; + } + } + + private void ClearImageGif() + { + if (this.ImageGif != null) + { + this.ImageGif.Source = null; + this.Content = null; + } + } + } +} diff --git a/src/AppStudio.Uwp/EventArguments/SourceEventArgs.cs b/src/AppStudio.Uwp/EventArguments/SourceEventArgs.cs new file mode 100644 index 00000000..6f396f3a --- /dev/null +++ b/src/AppStudio.Uwp/EventArguments/SourceEventArgs.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace AppStudio.Uwp.EventArguments +{ + public class SourceEventArgs : EventArgs + { + public string Source { get; } + public SourceEventArgs(string source) + { + Source = source; + } + } +} From 5189cd2eb82ab40d69d69cd7ca3cb241a080181f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Alarc=C3=B3n?= Date: Mon, 21 Nov 2016 11:58:40 +0100 Subject: [PATCH 2/4] Update certificates --- ...o.DataProviders.Test.WP81_TemporaryKey.pfx | Bin 2456 -> 2456 bytes ....DataProviders.Test.Win10_TemporaryKey.pfx | Bin 2456 -> 2456 bytes ....DataProviders.Test.Win81_TemporaryKey.pfx | Bin 2456 -> 2456 bytes 3 files changed, 0 insertions(+), 0 deletions(-) diff --git a/tests/AppStudio.DataProviders.Test.WP81/AppStudio.DataProviders.Test.WP81_TemporaryKey.pfx b/tests/AppStudio.DataProviders.Test.WP81/AppStudio.DataProviders.Test.WP81_TemporaryKey.pfx index 7a9a5b2502c65ca6faf64692327a2c9bd4af94bd..191c844fafe82eb45fdca0c1b694a5e07e274e5b 100644 GIT binary patch delta 1991 zcmV;&2RQhc6POc_Xn&`66N^#;K1>1v2haq91lWJoq+lLZ!qUE_m~Ben#R4_2Bp8dT zMMBt6MrD7#v@NS?U%}l6jl0K>I^hXsrNjLb@mC&X=;p8m>fZm~B77gtGetCEY1;`M zKfJr64{RSd)EleQ2Y2sQARiT#3tnvf!BRLoe4t@5=jwyJV1JM*<@TqH&Ab zyFNCo$NhMQ8pRg3Z#JMbDT&K&$JNB?h1UH>74JHms3zKp*k36y9Vt0We17j~k{F zu}2(!9e-+rstl}+C+V|!C8+!YRB2fcfm{PN2a9l2k^|8PsDb<|)v~>Bq700w8|qQ+ z^rj@6BXi)rVWvK}I{%PLR&NSsI@m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_1#?LxLchIAn=@a^y`0 diff --git a/tests/AppStudio.DataProviders.Test.Win10/AppStudio.DataProviders.Test.Win10_TemporaryKey.pfx b/tests/AppStudio.DataProviders.Test.Win10/AppStudio.DataProviders.Test.Win10_TemporaryKey.pfx index 7a9a5b2502c65ca6faf64692327a2c9bd4af94bd..191c844fafe82eb45fdca0c1b694a5e07e274e5b 100644 GIT binary patch delta 1991 zcmV;&2RQhc6POc_Xn&`66N^#;K1>1v2haq91lWJoq+lLZ!qUE_m~Ben#R4_2Bp8dT zMMBt6MrD7#v@NS?U%}l6jl0K>I^hXsrNjLb@mC&X=;p8m>fZm~B77gtGetCEY1;`M zKfJr64{RSd)EleQ2Y2sQARiT#3tnvf!BRLoe4t@5=jwyJV1JM*<@TqH&Ab zyFNCo$NhMQ8pRg3Z#JMbDT&K&$JNB?h1UH>74JHms3zKp*k36y9Vt0We17j~k{F zu}2(!9e-+rstl}+C+V|!C8+!YRB2fcfm{PN2a9l2k^|8PsDb<|)v~>Bq700w8|qQ+ z^rj@6BXi)rVWvK}I{%PLR&NSsI@mi*#CA-0MjjR!l_a#>g&v*bwO#{4(?V~Io{jXr z`xf}?+T&$T;(mH5nxaj`ywmIriH<9CshI{_!+*P1m#x3tEBx20VDkQ;t%|!0DzupJ zZhU!<6R>5(B*}n@^=Gxu*`=`XV|KiM%p9vhKCwi29X2CTcZxdnYs+n6_7tJNa*1DJ z>eK=oq5WwVn&7*7Ws5}PmHY~VddH?Kjl6oW{g8*IyS~YgL2!l-!CJY^r7Sc&V3Xb% zLVtt(9o~9{CY8ZfI=P-<4Bq`# z4fLa#HhTBr>?zn?HyHhVxrRcr{)8U@O|x1T`qIZ@QqLF~iR&VY5XY-vE!muDpb1&% z#aMU(-#X{`+oZ4jy>Gu%VsOuRw{q(uO4j|C~(Nhvuu<*mVa^F z#Pp3oRIrWZ`5*>8JwgQFDKbFOZG!M;5M{Nt6BvDFu)_dQkS)FSD2Hh<9iXe{GdblJoK`l?L;Sw1@HFkFAM3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`W&j(IYCB_jHX^4yK_O4o8G90)&r*r47Ff)W>y_O`M=nZ~OukhH5+U7ORf#Om3 zVEclmeyIgu;F=znRs z{dYj+JGFt@gF)`VphhrtZx~L`V4{6Rg2-x;cVqy-C*o)y1B$B;aazw4m z)g=m^Wuw^qC&(DlS5Jq!WYdU@VYSNVRu&kGL7xR|`QeF1#t@)Cgi?8c$=3u(Ji`koTdoWg>9P)vHjuEAY zJd(;vTy`PDs5-T}TC{_5><+9hHS93%roQQ@HDHY_@SE49sy{oNjUm+{eN zQ2i(!@Z>5%ADFy?4523~ag46`t_mnRG3!hTNh6stfz2=z1_>&LNQUD#sFjNX1@9jx zneNkymz=&28fLu7c(hZ_fcWYNDN!HfF{8EK&mBvmqlnBqTUA!7w{(Nc$ zGXuDojrpensRp#zWun8B1CH&XO*{hdq|m1D+W@z6P1s|vom@_2L|eTKTPECBD}USEcMSMX@Di!4Q+R9g*zv@htV z=rcqQm*?q_nMKqr$P|H=8q!d=raSuWXc*l&Jkk_WldRKf0Lq z=O7qM`m$#HCD^C>eTw-zcHR`K0_1#?LxLchIAn=@a^y`0 diff --git a/tests/AppStudio.DataProviders.Test.Win81/AppStudio.DataProviders.Test.Win81_TemporaryKey.pfx b/tests/AppStudio.DataProviders.Test.Win81/AppStudio.DataProviders.Test.Win81_TemporaryKey.pfx index 7a9a5b2502c65ca6faf64692327a2c9bd4af94bd..191c844fafe82eb45fdca0c1b694a5e07e274e5b 100644 GIT binary patch delta 1991 zcmV;&2RQhc6POc_Xn&`66N^#;K1>1v2haq91lWJoq+lLZ!qUE_m~Ben#R4_2Bp8dT zMMBt6MrD7#v@NS?U%}l6jl0K>I^hXsrNjLb@mC&X=;p8m>fZm~B77gtGetCEY1;`M zKfJr64{RSd)EleQ2Y2sQARiT#3tnvf!BRLoe4t@5=jwyJV1JM*<@TqH&Ab zyFNCo$NhMQ8pRg3Z#JMbDT&K&$JNB?h1UH>74JHms3zKp*k36y9Vt0We17j~k{F zu}2(!9e-+rstl}+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v@htV z=rcqQm*?q_nMKqr$P|H=8q!d=raSuWXc*l&Jkk_WldRKf0Lq z=O7qM`m$#HCD^C>eTw-zcHR`K0_1#?LxLchIAn=@a^y`0 From 2446d637ebf48cdd98a91c07ef78050da34fe329 Mon Sep 17 00:00:00 2001 From: Konstantin K Date: Tue, 20 Jun 2017 11:31:45 +0300 Subject: [PATCH 3/4] Fix 'utf-8' fallback encoding for RSS feed --- src/AppStudio.DataProviders/Core/HttpRequest.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/AppStudio.DataProviders/Core/HttpRequest.cs b/src/AppStudio.DataProviders/Core/HttpRequest.cs index 5aaa045b..2a50dd5a 100644 --- a/src/AppStudio.DataProviders/Core/HttpRequest.cs +++ b/src/AppStudio.DataProviders/Core/HttpRequest.cs @@ -146,6 +146,7 @@ private async static Task SetRssEncoding(HttpResponseMessage response) } } } + SetEncoding(response); } private static void SetEncoding(HttpResponseMessage response) From ba75a328b2302f390af8f0915a41a1484dc85ff7 Mon Sep 17 00:00:00 2001 From: Konstantin K Date: Tue, 20 Jun 2017 14:11:12 +0300 Subject: [PATCH 4/4] Fix encode for rss as a fallback --- src/AppStudio.DataProviders/Core/HttpRequest.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/AppStudio.DataProviders/Core/HttpRequest.cs b/src/AppStudio.DataProviders/Core/HttpRequest.cs index 2a50dd5a..c96e137e 100644 --- a/src/AppStudio.DataProviders/Core/HttpRequest.cs +++ b/src/AppStudio.DataProviders/Core/HttpRequest.cs @@ -142,11 +142,13 @@ private async static Task SetRssEncoding(HttpResponseMessage response) { response.Content.Headers.ContentType.CharSet = charset; } - } } + else + { + SetEncoding(response); + } } - SetEncoding(response); } private static void SetEncoding(HttpResponseMessage response)