mirror of
https://github.com/Stone-Red-Code/Decho.git
synced 2026-09-07 23:39:14 +02:00
Fix server URL retrieval
This commit is contained in:
@@ -79,7 +79,7 @@ public partial class MessageItemView : UserControl
|
|||||||
}
|
}
|
||||||
|
|
||||||
byte[]? bytes = await mainVm.ConnectionService.DownloadImageBytesAsync(
|
byte[]? bytes = await mainVm.ConnectionService.DownloadImageBytesAsync(
|
||||||
msg.ServerUrl ?? "", msg.Model.ChannelName, att.Url);
|
ResolveServerUrl(), msg.Model.ChannelName, att.Url);
|
||||||
|
|
||||||
if (bytes is null || bytes.Length == 0)
|
if (bytes is null || bytes.Length == 0)
|
||||||
{
|
{
|
||||||
@@ -189,11 +189,9 @@ public partial class MessageItemView : UserControl
|
|||||||
if (DataContext is MessageViewModel msg)
|
if (DataContext is MessageViewModel msg)
|
||||||
{
|
{
|
||||||
MainWindowViewModel? mainVm = this.GetMainWindowViewModel();
|
MainWindowViewModel? mainVm = this.GetMainWindowViewModel();
|
||||||
if (mainVm is not null)
|
return msg.ServerUrl ?? mainVm?.Chat.CurrentServerUrl ?? string.Empty;
|
||||||
{
|
|
||||||
return msg.ServerUrl ?? mainVm.Chat.CurrentServerUrl;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return string.Empty;
|
return string.Empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -210,7 +208,7 @@ public partial class MessageItemView : UserControl
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
string serverUrl = msg.ServerUrl ?? mainVm.Chat.CurrentServerUrl;
|
string serverUrl = ResolveServerUrl();
|
||||||
ServerViewModel? serverVm = mainVm.Sidebar.GetServer(serverUrl);
|
ServerViewModel? serverVm = mainVm.Sidebar.GetServer(serverUrl);
|
||||||
if (serverVm is null)
|
if (serverVm is null)
|
||||||
{
|
{
|
||||||
@@ -371,7 +369,7 @@ public partial class MessageItemView : UserControl
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
string serverUrl = msg.ServerUrl ?? "";
|
string serverUrl = ResolveServerUrl();
|
||||||
string channelName = msg.Model.ChannelName;
|
string channelName = msg.Model.ChannelName;
|
||||||
Func<Task<string?>> downloadAsync = async () =>
|
Func<Task<string?>> downloadAsync = async () =>
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user