Skip to content
Snippets Groups Projects
Verified Commit 2f957927 authored by Emilia's avatar Emilia
Browse files

Make the thing slightly cleaner

parent 406fa67d
Branches
Tags v13
No related merge requests found
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:login="clr-namespace:Blacklight.Views.Login" xmlns:login="clr-namespace:Blacklight.Views.Login"
xmlns:util="clr-namespace:Blacklight.Util" xmlns:util="clr-namespace:Blacklight.Util"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" mc:Ignorable="d" d:DesignWidth="1100" d:DesignHeight="700"
x:Class="Blacklight.Views.MainWindow" x:Class="Blacklight.Views.MainWindow"
x:DataType="vm:MainWindowViewModel" x:DataType="vm:MainWindowViewModel"
Icon="/Assets/avalonia-logo.ico" Icon="/Assets/avalonia-logo.ico"
......
...@@ -79,10 +79,8 @@ public partial class Client ...@@ -79,10 +79,8 @@ public partial class Client
foreach (var msg in res.Response.Messages) foreach (var msg in res.Response.Messages)
{ {
var replyAttribute = msg.SpecialAttributes.FirstOrDefault(a => a["type"]?.ToString() == "reply"); var replyAttribute = msg.SpecialAttributes.FirstOrDefault(a => a["type"]?.ToString() == "reply");
if (replyAttribute != null) if (replyAttribute == null) continue;
{ if (!ObjectId.TryParse(replyAttribute["replyTo"]?.ToString(), out var replyToId)) continue;
if (ObjectId.TryParse(replyAttribute["replyTo"]?.ToString(), out var replyToId))
{
var replyToMsg = res.Response.Messages.FirstOrDefault(m => m.Id == replyToId); var replyToMsg = res.Response.Messages.FirstOrDefault(m => m.Id == replyToId);
if (replyToMsg == null) if (replyToMsg == null)
{ {
...@@ -119,8 +117,6 @@ public partial class Client ...@@ -119,8 +117,6 @@ public partial class Client
msg.ReplyToMessage = replyToMsg; msg.ReplyToMessage = replyToMsg;
} }
}
}
return res.Response.Messages; return res.Response.Messages;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment