diff --git a/WeeXnes/App.xaml.cs b/WeeXnes/App.xaml.cs index 6e625e6..d92b58f 100644 --- a/WeeXnes/App.xaml.cs +++ b/WeeXnes/App.xaml.cs @@ -2,6 +2,7 @@ using System.ComponentModel; using System.Windows; using System.IO; +using System.Net; using System.Windows.Media; using Newtonsoft.Json.Linq; using Nocksoft.IO.ConfigFiles; @@ -188,6 +189,9 @@ namespace WeeXnes #if DEBUG DebugMode = true; HandleLaunchArguments.arg_enableConsole(); + //Allow untrusted certs in Debug mode + ServicePointManager.ServerCertificateValidationCallback += + (sender, cert, chain, sslPolicyErrors) => true; #endif } } diff --git a/WeeXnes/Core/Global.cs b/WeeXnes/Core/Global.cs index cc77607..ff7ce6f 100644 --- a/WeeXnes/Core/Global.cs +++ b/WeeXnes/Core/Global.cs @@ -8,7 +8,7 @@ namespace WeeXnes.Core { public class Information { - public const string Version = "4.4.8"; + public const string Version = "4.5.0"; public const string EncryptionHash = "8zf5#RdyQ]$4x4_"; public const string ApiUrl = "https://api.github.com/repos/weexnes/weexnessuite/releases/latest"; } diff --git a/WeeXnes/Core/LoginLib.cs b/WeeXnes/Core/LoginLib.cs index eef87ea..d355eff 100644 --- a/WeeXnes/Core/LoginLib.cs +++ b/WeeXnes/Core/LoginLib.cs @@ -37,6 +37,7 @@ namespace WeeXnes.Core } catch (Exception ex) { + WeeXnes.Core.CustomConsole.WriteLine(ex.ToString()); this.ExceptionCache.Value = ex; } }; @@ -114,6 +115,7 @@ namespace WeeXnes.Core // Parse the JSON data into a dynamic object dynamic user = JsonConvert.DeserializeObject(responseData); user = user.user; + // Now you can access the user object properties dynamically WeeXnes.Core.CustomConsole.WriteLine("authenticated user: " + user.name); //Console.WriteLine($"Email: {user.email}"); diff --git a/WeeXnes/MainWindow.xaml b/WeeXnes/MainWindow.xaml index fac605e..ee828db 100644 --- a/WeeXnes/MainWindow.xaml +++ b/WeeXnes/MainWindow.xaml @@ -92,7 +92,6 @@ PageTag="Gen" PageType="{x:Type passwordGenerator:PasswordGenView}"/> + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/WeeXnes/Views/ProfileView/InboxView.xaml.cs b/WeeXnes/Views/ProfileView/InboxView.xaml.cs new file mode 100644 index 0000000..f036bfc --- /dev/null +++ b/WeeXnes/Views/ProfileView/InboxView.xaml.cs @@ -0,0 +1,45 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Documents; +using WeeXnes.Core; +using Wpf.Ui.Controls; + +namespace WeeXnes.Views.ProfileView +{ + public partial class InboxView : Page + { + public InboxView() + { + InitializeComponent(); + } + + private void InboxView_OnLoaded(object sender, RoutedEventArgs e) + { + //header_label.Content = "Inbox of " + ProfileView.auth._currentUserCache.Value.name; + } + + private void InboxItemsLoaded(object sender, RoutedEventArgs e) + { + //Reverse the message list + List messageList = new List(); + foreach (var msg in ProfileView.auth._currentUserCache.Value.inbox) + { + messageList.Add(msg); + } + + messageList.Reverse(); + InboxItems.ItemsSource = messageList; + } + + private void ButtonBase_OnClick(object sender, RoutedEventArgs e) + { + CardAction button = (CardAction)sender; + dynamic messageObj = button.Tag; + MessageFullView.MessageToShow = messageObj; + NavigationService.Navigate(new Uri("/Views/ProfileView/MessageFullView.xaml",UriKind.Relative)); + } + } +} \ No newline at end of file diff --git a/WeeXnes/Views/ProfileView/LicenseView.xaml b/WeeXnes/Views/ProfileView/LicenseView.xaml new file mode 100644 index 0000000..a477cef --- /dev/null +++ b/WeeXnes/Views/ProfileView/LicenseView.xaml @@ -0,0 +1,15 @@ + + + + + + diff --git a/WeeXnes/Views/ProfileView/LicenseView.xaml.cs b/WeeXnes/Views/ProfileView/LicenseView.xaml.cs new file mode 100644 index 0000000..fdff78b --- /dev/null +++ b/WeeXnes/Views/ProfileView/LicenseView.xaml.cs @@ -0,0 +1,18 @@ +using System.Windows; +using System.Windows.Controls; + +namespace WeeXnes.Views.ProfileView +{ + public partial class LicenseView : Page + { + public LicenseView() + { + InitializeComponent(); + } + + private void LicenseView_OnLoaded(object sender, RoutedEventArgs e) + { + header_label.Content = "Licenses of " + ProfileView.auth._currentUserCache.Value.name; + } + } +} \ No newline at end of file diff --git a/WeeXnes/Views/ProfileView/MessageFullView.xaml b/WeeXnes/Views/ProfileView/MessageFullView.xaml new file mode 100644 index 0000000..4a34a73 --- /dev/null +++ b/WeeXnes/Views/ProfileView/MessageFullView.xaml @@ -0,0 +1,18 @@ + + + + + + + + diff --git a/WeeXnes/Views/ProfileView/MessageFullView.xaml.cs b/WeeXnes/Views/ProfileView/MessageFullView.xaml.cs new file mode 100644 index 0000000..6538326 --- /dev/null +++ b/WeeXnes/Views/ProfileView/MessageFullView.xaml.cs @@ -0,0 +1,30 @@ +using System.Windows; +using System.Windows.Controls; +using System.Windows.Documents; + +namespace WeeXnes.Views.ProfileView +{ + public partial class MessageFullView : Page + { + public static dynamic MessageToShow = null; + public MessageFullView() + { + InitializeComponent(); + } + + private void MessageFullView_OnLoaded(object sender, RoutedEventArgs e) + { + if(MessageToShow == null) + return; + AuthorLabel.Content = MessageToShow.Author; + MessageContent.Document.Blocks.Clear(); + MessageContent.Document.Blocks.Add( + new Paragraph( + new Run( + MessageToShow.Message.ToString() + ) + ) + ); + } + } +} \ No newline at end of file diff --git a/WeeXnes/Views/ProfileView/ProfileView.xaml b/WeeXnes/Views/ProfileView/ProfileView.xaml index 416dc91..cda86d0 100644 --- a/WeeXnes/Views/ProfileView/ProfileView.xaml +++ b/WeeXnes/Views/ProfileView/ProfileView.xaml @@ -45,7 +45,8 @@ + Name="InboxButton" + Click="InboxButton_OnClick"> + Click="LicenseButton_OnClick" + Name="LicenseButton" Margin="0,5,0,0" + Visibility="Collapsed"> { - new FluentMessageBox(auth.ExceptionCache.Value.Message).ShowDialog(); + new FluentMessageBox(auth.ExceptionCache.Value.ToString()).ShowDialog(); + errorStringChanged(); }); } @@ -91,5 +92,15 @@ namespace WeeXnes.Views.ProfileView NavigationService.Navigate(new Uri("/Views/ProfileView/LoginError.xaml",UriKind.Relative)); }); } + + private void InboxButton_OnClick(object sender, RoutedEventArgs e) + { + NavigationService.Navigate(new Uri("/Views/ProfileView/InboxView.xaml",UriKind.Relative)); + } + + private void LicenseButton_OnClick(object sender, RoutedEventArgs e) + { + NavigationService.Navigate(new Uri("/Views/ProfileView/LicenseView.xaml",UriKind.Relative)); + } } } \ No newline at end of file diff --git a/WeeXnes/WeeXnes.csproj b/WeeXnes/WeeXnes.csproj index c32932b..3d1eeba 100644 --- a/WeeXnes/WeeXnes.csproj +++ b/WeeXnes/WeeXnes.csproj @@ -4,7 +4,7 @@ Debug AnyCPU - 4.4.8 + 4.5.0 {4B33CEE7-C74D-43B9-B99A-8B273D5195BC} WinExe WeeXnes @@ -106,12 +106,21 @@ SaveToKeyManagerView.xaml + + InboxView.xaml + + + LicenseView.xaml + LoginError.xaml LoginView.xaml + + MessageFullView.xaml + ProfileView.xaml @@ -153,8 +162,11 @@ + + +