Compare commits

...

14 Commits

46 changed files with 4177 additions and 37279 deletions

View File

@@ -42,9 +42,8 @@
</Reference>
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="RestSharp, Version=105.2.3.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\BeWo\packages\RestSharp.106.15.0\lib\net452\RestSharp.dll</HintPath>
<Reference Include="RestSharp, Version=106.15.0.0, Culture=neutral, PublicKeyToken=598062e77f915f75, processorArchitecture=MSIL">
<HintPath>..\PrototypChat\packages\RestSharp.106.15.0\lib\net452\RestSharp.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />

View File

@@ -70,7 +70,7 @@ namespace ChatController.ChatKlassen
OriginalImage = originalImage;
OriginalImageName = imageName;
if(MessageId == 0 && MessageType == ChatMessageType.Image && !(logo is null))
if(MessageId == 0 && MessageType == ChatMessageType.Image && false == logo is null)
{
PictureSource = logo;
PicturePlaceholderHeight = (int) logo.Height;

View File

@@ -295,7 +295,7 @@ namespace ChatController
var contact = _ContactList.FirstOrDefault(a => a.Contact.GroupId == pGroupId);
if(!(contact is null))
if(false == contact is null)
{
notificationIcon = Utils.ImageSourceToIcon(contact.Contact.Image);
}
@@ -396,7 +396,7 @@ namespace ChatController
_ScrollPrueferAktivieren = false;
if(contact?.HasUnreadMessages ?? false)
if((bool) contact?.HasUnreadMessages)
{
contact.HasUnreadMessages = false;
@@ -404,22 +404,20 @@ namespace ChatController
OnPropertyChanged(nameof(ContactList));
}
var currentContact = contact;
contact.IsNewMessage = false;
var shouldChangeIcon = _ContactList.Any(contactDependencyObject => contactDependencyObject?.Contact?.IsNewMessage ?? false);
if(shouldChangeIcon && ContainingWindow != null)
if(shouldChangeIcon && false == ContainingWindow is null)
{
ContainingWindow.Icon = Utils.ConvertIconToImageSource(Resource.ownchat_favicon);
}
CurrentContact = currentContact;
CurrentContact = contact;
OnPropertyChanged(nameof(IsSendButtonEnabled));
if(!(Clientlist is null))
if(false == Clientlist is null)
{
foreach(var obj in Clientlist.Items)
{
@@ -433,7 +431,7 @@ namespace ChatController
_ChatMessages?.Clear();
OnPropertyChanged(nameof(_ChatMessages));
Chat?.LoadChatMessagesForContactAsync(currentContact, GetFirstMessage(), chatMessages =>
Chat?.LoadChatMessagesForContactAsync(contact, GetFirstMessage(), chatMessages =>
{
this.Dispatch(() =>
{
@@ -656,7 +654,7 @@ namespace ChatController
return;
}
StartWaitingImmediately("Skaliere Bild ...");
StartWaitingImmediately("Skaliere Bild...");
var scalingTask = new Task(() =>
{
@@ -745,7 +743,7 @@ namespace ChatController
{
_ChatMessageFileWrapper = value;
OnPropertyChanged(nameof(ChatMessageFileWrapper));
OnPropertyChanged();
OnPropertyChanged(nameof(IsSendButtonEnabled));
OnPropertyChanged(nameof(FilePreviewGridVisibility));
OnPropertyChanged(nameof(ChatListBoxVisibility));
@@ -781,23 +779,6 @@ namespace ChatController
private void Chatbox_OnKeyDownHandler(object sender, KeyEventArgs e)
{
//if (e.Key == Key.Return)
//{
// if(CurrentContact != null && !string.IsNullOrEmpty(Chatbox.Text))
// {
// Chat.AddNewMessage(Chatbox.Text, CurrentContact.GroupId);
// OnPropertyChanged(nameof(CurrentChatMessages));
// ChatListBox.Items.MoveCurrentToLast();
// ChatListBox.ScrollIntoView(ChatListBox.Items.CurrentItem);
// Chat.SendMessage(Chatbox.Text, CurrentContact.GroupId);
// Chatbox.Text = string.Empty;
// }
//}
OnPropertyChanged(nameof(IsBroadcastButtonEnabled));
OnPropertyChanged(nameof(IsSendButtonEnabled));
}
@@ -934,13 +915,12 @@ namespace ChatController
var userOid = Chat.ChatDaten.LoggedInUser.Response.User.Oid;
var senderId = contactDependencyObject.Contact.ReceivedMessage?.UserId;
var receiverId = userOid;
var receiverGroupId = newContact.GroupId;
var selectedGroupId = selectedContact?.GroupId;
if(senderId != receiverId && (_IsInBackground || receiverGroupId != selectedGroupId))
if(senderId != userOid && (_IsInBackground || receiverGroupId != selectedGroupId))
{
if(!(ContainingWindow is null))
if(false == ContainingWindow is null)
{
ContainingWindow.Icon = Utils.ConvertIconToImageSource(Resource.oC_favico_NewMessage);
}
@@ -949,7 +929,7 @@ namespace ChatController
}
// Wenn der momentan ausgewählte Kontakt der aktuelle Kontakt in der Schleife ist, werden die Nachrichten nicht als ungelesen angezeigt, sonst schon.
if(!(CurrentContact is null) && newContact.GroupId == CurrentContact.GroupId)
if(false == CurrentContact is null && newContact.GroupId == CurrentContact.GroupId)
{
contactDependencyObject.Contact.HasUnreadMessages = false;
}

View File

@@ -13,6 +13,7 @@ using System.Net.Http;
using System.Runtime.CompilerServices;
using System.Threading;
using System.Threading.Tasks;
using System.Web.UI.WebControls;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
@@ -88,7 +89,7 @@ namespace ChatController.HauptKlassen
// Führt zu doppelter neuester Nachricht, wenn man vorher eine verschickt hat!
public void LoadChatMessagesForContactAsync(Contact contact, ChatMessage previousMessage, Action<List<ChatMessage>> callback)
{
if(!(contact is null))
if(false == contact is null)
{
LoadMessagesFromServerAsync(contact.GroupId, delegate
{
@@ -129,6 +130,8 @@ namespace ChatController.HauptKlassen
});
}
public void LoadMoreMessagesAsync(Contact contact, ChatMessage previousMessage, Action<List<ChatMessage>> callback)
{
LoadMoreMessagesFromServerAsync(contact.GroupId, _NextPage, () =>
@@ -802,12 +805,26 @@ namespace ChatController.HauptKlassen
});
}
public void ReloadGroupsAsync(Action<ChatGruppenDaten> callback)
public async Task ReloadGroupsAsync(Action<ChatGruppenDaten> callback)
{
var url = ChatDaten.ServerUrl + Constants.GetChatGroupsUrl;
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
// ToDo: Durch HttpClient ersetzen
using(var httpClient = new HttpClient())
{
httpClient.DefaultRequestHeaders.Add(Constants.Token, ChatDaten.AuthToken);
httpClient.DefaultRequestHeaders.Add(Constants.CustomerId, ChatDaten.Kundennummer);
var test = await httpClient.GetStringAsync(url);
var gruppen = JsonConvert.DeserializeObject<ChatGruppenDaten>(test);
}
var client = new RestClient(url);
var request = new RestRequest();
@@ -930,14 +947,14 @@ namespace ChatController.HauptKlassen
var clientZone = TimeZoneInfo.Local;
var formattedTime = TimeZoneInfo.ConvertTimeFromUtc(time, clientZone);
var isLoggedInUsersMessage = !(ChatDaten.Userid is null) && message.UserId == ChatDaten.Userid.Value;
var messageText = message.Text ?? (string.IsNullOrEmpty(message.File) ? string.Empty : message.OriginalFilename);
var isLoggedInUsersMessage = false == ChatDaten.Userid is null && message.UserId == ChatDaten.Userid.Value;
var messageText = message.Text ?? (string.IsNullOrEmpty(message.FileProtected) ? string.Empty : message.OriginalFilename);
if(!string.IsNullOrEmpty(message.File))
if(false == string.IsNullOrEmpty(message.FileProtected))
{
var message2Add = Constants.ImageFileExtensions.Contains(Path.GetExtension(message.File).ToUpperInvariant()) ? //SmallerImage ist null
new ChatMessage(message.GroupId, message.Id, message.UserName, messageText, formattedTime, isLoggedInUsersMessage, message.FileSize, message.SmallerImage, message.File, message.OriginalFilename, null, null, ChatMessageType.Image, message.UserId) :
new ChatMessage(message.GroupId, message.Id, message.UserName, messageText, formattedTime, isLoggedInUsersMessage, 0, message.File, null, null, message.SmallerImage, null, ChatMessageType.Document, message.UserId);
var message2Add = Constants.ImageFileExtensions.Contains(Path.GetExtension(message.FileProtected).ToUpperInvariant()) ? //SmallerImage ist null
new ChatMessage(message.GroupId, message.Id, message.UserName, messageText, formattedTime, isLoggedInUsersMessage, message.FileSize, message.SmallerImage, message.FileProtected, message.OriginalFilename, null, null, ChatMessageType.Image, message.UserId) :
new ChatMessage(message.GroupId, message.Id, message.UserName, messageText, formattedTime, isLoggedInUsersMessage, 0, message.FileProtected, null, null, message.SmallerImage, null, ChatMessageType.Document, message.UserId);
result.AddIfNotIn(message2Add);
}
@@ -959,9 +976,7 @@ namespace ChatController.HauptKlassen
chatMessages = new List<ChatMessage>();
}
var test = chatMessages.Any(a => a is null);
var messagesWithoutSeparators = chatMessages.Where(message => !message.IsSeparator).OrderBy(message => message.SendTime).ToList();
var messagesWithoutSeparators = chatMessages.Where(message => message != null && false == message.IsSeparator).OrderBy(message => message.SendTime).ToList();
var separators = new List<ChatMessage>();
@@ -969,7 +984,7 @@ namespace ChatController.HauptKlassen
foreach(var message in messagesWithoutSeparators.OrderBy(message => message.SendTime))
{
if(!message.Equals(previousMessage) && !(previousMessage is null))
if(false == message.Equals(previousMessage) && false == previousMessage is null)
{
if(message.SendTime.Date != previousMessage.SendTime.Date)
{

View File

@@ -3,8 +3,6 @@ using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Net;
using System.Net.Security;
using System.Security.Cryptography.X509Certificates;
using System.Web;
using System.Windows;
using ChatController.Core;

View File

@@ -4,6 +4,7 @@ using System.ComponentModel;
using System.IO;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Threading;
using ChatController.Annotations;
@@ -33,7 +34,7 @@ namespace ChatController
}
_Benutzername = value;
OnPropertyChanged(nameof(UserName));
OnPropertyChanged();
}
}
@@ -56,7 +57,7 @@ namespace ChatController
}
_ChatCode = value;
OnPropertyChanged(nameof(ChatCode));
OnPropertyChanged();
}
}
@@ -72,7 +73,7 @@ namespace ChatController
}
_Kundennummer = value;
OnPropertyChanged(nameof(Tenant));
OnPropertyChanged();
}
}
@@ -83,7 +84,7 @@ namespace ChatController
private string _Benutzername = string.Empty;
private string _ChatCode = string.Empty;
private string _Kundennummer = string.Empty;
private readonly string _Version = "1.13";
private readonly string _Version = "1.15";
public string Version => $"Version: {_Version}";
@@ -201,17 +202,16 @@ namespace ChatController
#if DEBUG
//var debugFile = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), "debug-info.txt");
if(Tenant == "1122334455" && Directory.Exists(@"C:\Users\Lyndon Jetten"))
if(Tenant == "1122334455" && Directory.Exists(@"C:\Users\Lyndon"))
{
ChatCode = "HprNe -1MwMB";
UserName = "MikeGahn";
Password = "TW2024!!!";
return;
}
var debugFile = @"C:\Users\Lyndon Jetten\Desktop\debug-info.txt";
if (File.Exists(debugFile))
var debugFile = @"C:\Users\Lyndon\Documents\ownchat-desktop-debug-info.txt";
if(File.Exists(debugFile))
{
using(var streamReader2 = new StreamReader(debugFile, true))
{

View File

@@ -1,5 +1,4 @@
using System;
using Newtonsoft.Json;
using Newtonsoft.Json;
namespace ChatController.LoginKlassen
{
@@ -50,6 +49,9 @@ namespace ChatController.LoginKlassen
[JsonProperty("file")]
public string File { get; set; }
[JsonProperty("file_protected")]
public string FileProtected { get; set; }
[JsonProperty("original_filename")]
public string OriginalFilename { get; set; }

View File

@@ -1,10 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Security;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using System.Threading.Tasks;
namespace ChatController.Security
{
@@ -12,23 +8,37 @@ namespace ChatController.Security
{
//!!!!Wenn hier neue Keys hinzugefügt werden, muss das auch in der Klasse BeWo.LoginControl und im DatabaseTerminator gemacht werden!!
public const string PinningFailMessage = "Es konnte keine sichere Verbindung zum Server hergestellt werden.";
public static string PinningFailMessage = "Es konnte keine sichere Verbindung zum Server hergestellt werden.";
private const String PUB_KEY_X3 = "9CD30CF05AE52E47B7725D3783B3686330EAD735261925E1BDBE35F170922FB7B84B4105ABA99E350858ECB12AC468870BA3E375E4E6F3A76271BA7981601FD7919A9FF3D0786771C8690E9591CFFEE699E9603C48CC7ECA4D7712249D471B5AEBB9EC1E37001C9CAC7BA705EACE4AEBBD41E53698B9CBFD6D3C9668DF232A42900C867467C87FA59AB8526114133F65E98287CBDBFA0E56F68689F3853F9786AFB0DC1AEF6B0D95167DC42BA065B299043675806BAC4AF31B9049782FA2964F2A20252904C674C0D031CD8F31389516BAA833B843F1B11FC3307FA27931133D2D36F8E3FCF2336AB93931C5AFC48D0D1D641633AAFA8429B6D40BC0D87DC3930203010001";
private static String PUB_KEY_X3 = "9CD30CF05AE52E47B7725D3783B3686330EAD735261925E1BDBE35F170922FB7B84B4105ABA99E350858ECB12AC468870BA3E375E4E6F3A76271BA7981601FD7919A9FF3D0786771C8690E9591CFFEE699E9603C48CC7ECA4D7712249D471B5AEBB9EC1E37001C9CAC7BA705EACE4AEBBD41E53698B9CBFD6D3C9668DF232A42900C867467C87FA59AB8526114133F65E98287CBDBFA0E56F68689F3853F9786AFB0DC1AEF6B0D95167DC42BA065B299043675806BAC4AF31B9049782FA2964F2A20252904C674C0D031CD8F31389516BAA833B843F1B11FC3307FA27931133D2D36F8E3FCF2336AB93931C5AFC48D0D1D641633AAFA8429B6D40BC0D87DC3930203010001";
private const String PUB_KEY_R3 = "BB021528CCF6A094D30F12EC8D5592C3F882F199A67A4288A75D26AAB52BB9C54CB1AF8E6BF975C8A3D70F4794145535578C9EA8A23919F5823C42A94E6EF53BC32EDB8DC0B05CF35938E7EDCF69F05A0B1BBEC094242587FA3771B313E71CACE19BEFDBE43B45524596A9C153CE34C852EEB5AEED8FDE6070E2A554ABB66D0E97A540346B2BD3BC66EB66347CFA6B8B8F572999F830175DBA726FFB81C5ADD286583D17C7E709BBF12BF786DCC1DA715DD446E3CCAD25C188BC60677566B3F118F7A25CE653FF3A88B647A5FF1318EA9809773F9D53F9CF01E5F5A6701714AF63A4FF99B3939DDC53A706FE48851DA169AE2575BB13CC5203F5ED51A18BDB150203010001";
private static String PUB_KEY_R3 = "BB021528CCF6A094D30F12EC8D5592C3F882F199A67A4288A75D26AAB52BB9C54CB1AF8E6BF975C8A3D70F4794145535578C9EA8A23919F5823C42A94E6EF53BC32EDB8DC0B05CF35938E7EDCF69F05A0B1BBEC094242587FA3771B313E71CACE19BEFDBE43B45524596A9C153CE34C852EEB5AEED8FDE6070E2A554ABB66D0E97A540346B2BD3BC66EB66347CFA6B8B8F572999F830175DBA726FFB81C5ADD286583D17C7E709BBF12BF786DCC1DA715DD446E3CCAD25C188BC60677566B3F118F7A25CE653FF3A88B647A5FF1318EA9809773F9D53F9CF01E5F5A6701714AF63A4FF99B3939DDC53A706FE48851DA169AE2575BB13CC5203F5ED51A18BDB150203010001";
private const String PUB_KEY_E1 = "245c2da22afd1c4ba65d97732731acb2a06962ef65e8a6b0f0ac4b9fff1c0b700fd3982f4dfc0f009b37f074055732972e05ef2a4325a3fb6e342713f64f7e69d302995eeb244792c1249be6b1218fc12481fc68cc1f69ba58f51922f774c616";
private static String PUB_KEY_E1 = "245c2da22afd1c4ba65d97732731acb2a06962ef65e8a6b0f0ac4b9fff1c0b700fd3982f4dfc0f009b37f074055732972e05ef2a4325a3fb6e342713f64f7e69d302995eeb244792c1249be6b1218fc12481fc68cc1f69ba58f51922f774c616";
private const String PUB_KEY_E5 = "0d0b3a8a6b618eb6efdc5f58e7c6424554ab63f66661480a2e5975b481023750b73f1679dc98eca1289772201c2ccfd57c52204e54785b84146bc090ae85ecc051413c5a877f064dd4fe60d1fa6c2de17d951088a208540f991a4ce6ea0aacd8";
private static String PUB_KEY_E5 = "0d0b3a8a6b618eb6efdc5f58e7c6424554ab63f66661480a2e5975b481023750b73f1679dc98eca1289772201c2ccfd57c52204e54785b84146bc090ae85ecc051413c5a877f064dd4fe60d1fa6c2de17d951088a208540f991a4ce6ea0aacd8";
private const String PUB_KEY_E6 = "d9f19e4687f8217160a826eba3fab9eada1db912a7d426d95114b1617c7596bf220b391fd5bed10a46aa2d3c4a09842ebe409555e91940376675ed324e770449f8707bc318e7cef77110feac74d800d4ed6d1c731633109c3ab2ea6c62f4bdb8";
private static String PUB_KEY_E6 = "d9f19e4687f8217160a826eba3fab9eada1db912a7d426d95114b1617c7596bf220b391fd5bed10a46aa2d3c4a09842ebe409555e91940376675ed324e770449f8707bc318e7cef77110feac74d800d4ed6d1c731633109c3ab2ea6c62f4bdb8";
private const String PUB_KEY_R10 = "CF57E5E6C45412EDB447FEC92758764650288C1D3E88DF059DD5B51829BDDDB55ABFFAF6CEA3BEAF00214B625A5A3C012FC55803F689FF8E1143EBC1B5E01407968F6F1FD7E7BA8139097565B7C2AF185B372628E7A3F4072B6D1AFFAB58BC95AE40FFE9CB57C4B55B7F780D1861BC17E754C6BB4991CD6E18D18085EEA66536BC74EABC504CEAFC21F338169394BAB0D36B3806CD16127ACA5275C8AD76B2C29C5D98455C6F617BC62DEE3C13528601D957E6381CDF8DB51F92919AE74A1CCC45A87255F0B0E6A307ECFDA71B669E3F488B71847158C93AFAEF5EF25B442B3C74E78FB247C1076ACD9AB70D96F712812651540AEC61F6F7F5E2F28AC8950D8D0203010001";
private static String PUB_KEY_E7 = "0441e8049308587fbe37300cc0a041eafe56da84933ec900dbab6712cff94f5309e8a82fab29e59f1546f45b624e0fd4834199b79f4072451c2c5c4a32a6c2dbc6056a65ffdadaf075b4403b146895b6a8e26a71e274655153de16d41e27c133fd";
private const String PUB_KEY_R11 = "BA87BC5C1B0039CBCA0ACDD46710F9013CA54EA561CB26CA52FB1501B7B928F5281EED27B324183967090C08ECE03AB03B770EBDF3E53954410C4EAE41D69974DE51DBEF7BFF58BDA8B713F6DE31D5F272C9726A0B8374959C4600641499F3B1D922D9CDA892AA1C267A3FFEEF58057B089581DB710F8EFBE33109BB09BE504D5F8F91763D5A9D9E83F2E9C466B3E106664348188065A037189A9B843297B1B2BDC4F815009D2788FBE26317966C9B27674BC4DB285E69C279F0495CE02450E1C4BCA105AC7B406D00B4C2413FA758B82FC55C9BA5BB099EF1FEEBB08539FDA80AEF45C478EB652AC2CF5F3CDEE35C4D1BF70B272BAA0B4277534F796A1D87D90203010001";
private static String PUB_KEY_E8 = "04d165f25edc4bb40c029cd2b2faeee96cab3aae38a1f4d4393233c542d4cc330c34c7212090705ce8622f1c71b342d779be460dc1db47a113a0c7df8126633bd48d1df63d823332f6f42be7f5963ab41367187b6b3e8d48d9eadeedae6d3e874c";
private static String PUB_KEY_R10 = "CF57E5E6C45412EDB447FEC92758764650288C1D3E88DF059DD5B51829BDDDB55ABFFAF6CEA3BEAF00214B625A5A3C012FC55803F689FF8E1143EBC1B5E01407968F6F1FD7E7BA8139097565B7C2AF185B372628E7A3F4072B6D1AFFAB58BC95AE40FFE9CB57C4B55B7F780D1861BC17E754C6BB4991CD6E18D18085EEA66536BC74EABC504CEAFC21F338169394BAB0D36B3806CD16127ACA5275C8AD76B2C29C5D98455C6F617BC62DEE3C13528601D957E6381CDF8DB51F92919AE74A1CCC45A87255F0B0E6A307ECFDA71B669E3F488B71847158C93AFAEF5EF25B442B3C74E78FB247C1076ACD9AB70D96F712812651540AEC61F6F7F5E2F28AC8950D8D0203010001";
private static String PUB_KEY_R11 = "BA87BC5C1B0039CBCA0ACDD46710F9013CA54EA561CB26CA52FB1501B7B928F5281EED27B324183967090C08ECE03AB03B770EBDF3E53954410C4EAE41D69974DE51DBEF7BFF58BDA8B713F6DE31D5F272C9726A0B8374959C4600641499F3B1D922D9CDA892AA1C267A3FFEEF58057B089581DB710F8EFBE33109BB09BE504D5F8F91763D5A9D9E83F2E9C466B3E106664348188065A037189A9B843297B1B2BDC4F815009D2788FBE26317966C9B27674BC4DB285E69C279F0495CE02450E1C4BCA105AC7B406D00B4C2413FA758B82FC55C9BA5BB099EF1FEEBB08539FDA80AEF45C478EB652AC2CF5F3CDEE35C4D1BF70B272BAA0B4277534F796A1D87D90203010001";
private static String PUB_KEY_R12 = "00da982874adbe94fe3be01ee2e54b75ab2c127feda703327e3697ece8318fa5138d0b992e1ecd01513d4ce5286e095531aaa5225d72f42d07c24d403cdf0123b97837f51a653234e686719d04ef84085bbd021a99eba601009a73906d8fa207a0d097d3da456181353d14f9c4c05f6adc0b961ab09fe32aeabd2ad698c79b71ab3b740f3cdbb260be5a4b4e18e9db2a735c8961659efeed3ca6cb4e6fe49ef90046b3ff194d2a63b38e66c6188570c750656f3b74e548830f08585d2d239d5ea3fee8db00a1d2f4e3194df2ee7af6279ee5cd9c2da2f27f9c17adef133739d1b4c82c41d686c0e9ec21f8591b7fb93a7c9f5c019d6204c228bd0aad3cca10";
private static String PUB_KEY_R13 = "00a567708dd0568164151761cdb906d4ad19908c2650379816639254dbd9cc840593ecd3ec081ba0605143487d2bc748969eb42dda9dc8273b57a19fabf0d60ed40e30ca6f9bb1d1d6a49d323e584e356f4558687117fc3ed85d82a02fb2516cb01a5db859ce3565c88ba1af1037ffe39c5dc2491734ff8c2b8b8df0bc712c930c1d05c4bac7cdaac95e7cd1c901f79c03f6fc0a5df4da7be6db764270ebf44d22da00776fd6c95f17fdda752ea5570cf6ea5cb6e073a568cfa174e275827e109fc1f5a2eb01e938b10a44ccd3c289f54935820a34b31ce988c2474e820e0a36f0474f8af1290475dacde19a5cff5e9d9895ba9a43d04aa21705010430d332b38f";
private static String PUB_KEY_YE1 = "0407655075fe68a695ada17d2babca549c8cf31968e2572f3fcd9c0736b32966f160f2854f42729fb3012422e6f4b0186263486925903f5f74f47c1a9c8320e2230847eb9dbb7fbfe65210f2cb1066da33a11c7036cdee9f71b5e226d80bdffabc";
private static String PUB_KEY_YE2 = "04719ab43391d6c410bdcca97b7774942db58738edac647434c7b9de533ea336cf9b920f97269345ab1e5597be796fa812ea881df8925bb121b98cc808aadff603e9ef34fef576e7d2bc5d021d8c55e5a1839ad26214ef57fb1d0d3d3ef603970f";
private static String PUB_KEY_YR1 = "00a158bc5f6c42620317bc9c4d3caa7fa05d7750c8263c0041d3b5422cd0eda179adf65b8464d252055d745724f53f3e8b0fc66ad5dda0738dd6365d40751ae3e2c1276b36ce8b3d273e9986069da1ba2e3da19b43218eb074a799022e416cd536d021fa45204130b490f5c5eb1fc77176fe0f009e39b2c18c2faf14484dc1b230b66ba70037d2f90a05d52108b9b5f3624cfa05659dd2d0e957a8b9a6b5d57de6e75601be5be9efc5e3d0e20ac1f4634d0083bd815486f5873ca798a7be5f49844414edb1bdc1c26a55f62a5e06330ba11fc3f5c1f11d0096a22e654e65f0634d79279ac67a5cf59d98c9bb1736922a1a5f6f572419e13243f9df5ad2746e6e33";
private static String PUB_KEY_YR2 = "00d9d0bc70069a6a87ce25baa31ead5fde78bfdf5d0ee62d042fd4b9e958a65bcaf1a9c7ac21e807e7b2502717a7b04e470703e8123a806f9b70df9b4e80b86885f8a46eb787c0728c2a9c0410096f7cf903cffde3afff0ba0ec8ca4e0d90ec5fd88ea0d9fe794fa9c9a0e4cb15cba4791abcd091901186a7f9d3c5afd38652040ada118a80d916f3ba5aa69b0e02e50972ba18851b79b948ace2a6998ab7a2b1ebb7da0cc324d04088ab6cbdde875f8bf6e5ba6444d712fc1fc6b5cf6455b5290fed8f2cfc5d7a2dd38a6e79938b5f0045f00f6ab288f4f1ad336aea537e00caf983673574daa4393c23c5e57a2f99693f5ac6898bcb9d168f94eab26513d6fb9";
public static bool PinPublicKey(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslpolicyerrors)
{
@@ -38,18 +48,26 @@ namespace ChatController.Security
return false;
bool chainContainsPk = false;
foreach (var element in chain.ChainElements)
{
String pk = element.Certificate.GetPublicKeyString().ToLower();
if (pk.Contains(PUB_KEY_X3.ToLower()) ||
pk.Contains(PUB_KEY_R3.ToLower()) ||
pk.Contains(PUB_KEY_E1.ToLower()) ||
pk.Contains(PUB_KEY_E5.ToLower()) ||
pk.Contains(PUB_KEY_E6.ToLower()) ||
pk.Contains(PUB_KEY_E7.ToLower()) ||
pk.Contains(PUB_KEY_E8.ToLower()) ||
pk.Contains(PUB_KEY_R10.ToLower()) ||
pk.Contains(PUB_KEY_R11.ToLower()))
pk.Contains(PUB_KEY_R11.ToLower()) ||
pk.Contains(PUB_KEY_R12.ToLower()) ||
pk.Contains(PUB_KEY_R13.ToLower()) ||
pk.Contains(PUB_KEY_YE1.ToLower()) ||
pk.Contains(PUB_KEY_YE2.ToLower()) ||
pk.Contains(PUB_KEY_YR1.ToLower()) ||
pk.Contains(PUB_KEY_YR2.ToLower()))
{
chainContainsPk = true;
}
@@ -63,7 +81,6 @@ namespace ChatController.Security
{
return false;
}
}
}
}
}

View File

@@ -5,7 +5,6 @@ using System.Runtime.CompilerServices;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using ChatController.Annotations;
using ChatController.Core;
namespace ChatController.Utilities
{
@@ -20,7 +19,7 @@ namespace ChatController.Utilities
set
{
_OriginalFilePath = value;
OnPropertyChanged(nameof(OriginalFilePath));
OnPropertyChanged();
OnPropertyChanged(nameof(FileName));
}
}
@@ -32,7 +31,7 @@ namespace ChatController.Utilities
set
{
_ScaledFilePath = value;
OnPropertyChanged(nameof(ScaledFilePath));
OnPropertyChanged();
}
}
@@ -44,7 +43,7 @@ namespace ChatController.Utilities
private set
{
_ChatMessageImageSource = value;
OnPropertyChanged(nameof(ChatMessageImageSource));
OnPropertyChanged();
}
}
@@ -55,7 +54,7 @@ namespace ChatController.Utilities
var uri = new Uri(scaledFilePath);
if (Constants.ImageFileExtensions.Contains(Path.GetExtension(scaledFilePath).ToUpperInvariant()) && uri.IsFile)
if(Constants.ImageFileExtensions.Contains(Path.GetExtension(scaledFilePath).ToUpperInvariant()) && uri.IsFile)
{
var bitmap = new BitmapImage(uri);
bitmap.Freeze();

View File

@@ -36,6 +36,8 @@ namespace ChatController.Utilities
}
}
private static readonly object _Lock = new object();
/// <summary>
/// Lädt ein Bild aus einer Nachricht herunter.
/// </summary>
@@ -80,7 +82,7 @@ namespace ChatController.Utilities
request.AddHeader(Constants.Token, AuthToken);
request.AddHeader(Constants.CustomerId, Tenant);
client.ExecuteAsync(request, null);
client.ExecuteAsync(request, (a,b)=>{});
}
private static Rotation GetRotationFromExifTag(int value)
@@ -110,7 +112,7 @@ namespace ChatController.Utilities
var cachedImage = cache.GetImageSourceFromCache(key, uri, cacheCategory);
if(!(cachedImage is null))
if(false == cachedImage is null)
{
callback?.Invoke(cachedImage);
return;

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="RestSharp" version="105.2.3" targetFramework="net45" requireReinstallation="true" />
<package id="RestSharp" version="106.15.0" targetFramework="net452" />
</packages>

View File

@@ -1,4 +1,5 @@
using System.Windows.Input;
using System.Threading.Tasks;
using System.Windows.Input;
using ChatController.LoginKlassen;
namespace ownChat

View File

@@ -28,8 +28,8 @@
<InstallUrl>https://app.ownsoft.de/ownChat/</InstallUrl>
<ProductName>ownChat Desktop</ProductName>
<PublisherName>ownSoft GmbH</PublisherName>
<MinimumRequiredVersion>1.0.0.42</MinimumRequiredVersion>
<ApplicationRevision>43</ApplicationRevision>
<MinimumRequiredVersion>1.0.0.44</MinimumRequiredVersion>
<ApplicationRevision>45</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<CreateDesktopShortcut>true</CreateDesktopShortcut>
@@ -56,7 +56,7 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<ManifestCertificateThumbprint>8CA4066C36C87B745E4016FDA715A6DB16FCFFA9</ManifestCertificateThumbprint>
<ManifestCertificateThumbprint>8E3A8E81F1C6F67A1C6D239593544EA33D8AC6A7</ManifestCertificateThumbprint>
</PropertyGroup>
<PropertyGroup>
<ManifestKeyFile>
@@ -66,7 +66,7 @@
<GenerateManifests>true</GenerateManifests>
</PropertyGroup>
<PropertyGroup>
<SignManifests>false</SignManifests>
<SignManifests>true</SignManifests>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>ownchat_favicon.ico</ApplicationIcon>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,20 +0,0 @@
*** IMPORTANT CHANGE IN RESTSHARP VERSION 103 ***
In 103.0, JSON.NET was removed as a dependency.
If this is still installed in your project and no other libraries depend on
it you may remove it from your installed packages.
There is one breaking change: the default Json*Serializer* is no longer
compatible with Json.NET. To use Json.NET for serialization, copy the code
from https://github.com/restsharp/RestSharp/blob/86b31f9adf049d7fb821de8279154f41a17b36f7/RestSharp/Serializers/JsonSerializer.cs
and register it with your client:
var client = new RestClient();
client.JsonSerializer = new YourCustomSerializer();
The default Json*Deserializer* is mostly compatible, but it does not support
all features which Json.NET has (like the ability to support a custom [JsonConverter]
by decorating a certain property with an attribute). If you need these features, you
must take care of the deserialization yourself to get it working.

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB