Merge branch 'master' of ssh://float.beyondsoft.de/git/beyondSoft/Chat

This commit is contained in:
Christian
2021-11-24 17:13:11 +01:00
4 changed files with 74 additions and 57 deletions

View File

@@ -322,7 +322,9 @@ namespace ChatController
private void SelectContact(Contact pContact)
{
if(pContact == null)
try
{
if (pContact == null)
{
return;
}
@@ -344,14 +346,14 @@ namespace ChatController
pContact.IsNewMessage = false;
var shouldChangeIcon = _ContactList.Any(contact => contact.IsNewMessage);
if(shouldChangeIcon)
if (shouldChangeIcon)
{
ContainingWindow.Icon = Utils.ConvertIconToImageSource(Resource.ownchat_favicon);
}
CurrentContact = currentContact;
if(Clientlist.Items.Contains(pContact))
if (Clientlist.Items.Contains(pContact))
{
Clientlist.SelectedItem = pContact;
}
@@ -381,6 +383,23 @@ namespace ChatController
});
});
}
catch(Exception exception)
{
#if DEBUG
var desktop = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory);
using(var fileStream = new FileStream(Path.Combine(desktop, "ownchat_log.txt"), FileMode.OpenOrCreate))
{
using(var streamWriter = new StreamWriter(fileStream))
{
streamWriter.WriteLine(exception.ToString());
}
}
#endif
MessageBox.Show(exception.Message, "Fehler", MessageBoxButton.OK, MessageBoxImage.Error);
}
}
private void SetContextHandler()
{

View File

@@ -255,7 +255,7 @@ namespace ChatController.HauptKlassen
{
var messageCounter = JsonConvert.DeserializeObject<MessageCounter>(response.Content);
callback?.Invoke(messageCounter.MessageCount);
callback?.Invoke(messageCounter?.MessageCount ?? 0);
});
}
catch(Exception exception)
@@ -1029,7 +1029,10 @@ namespace ChatController.HauptKlassen
{
_Contacts.Clear();
if(chatDaten?.Response != null)
{
_Contacts.AddRange(GenerateContactsFromServerResponse(chatDaten.Response.Groups.ToArray()));
}
return _Contacts;
}

View File

@@ -101,11 +101,6 @@ namespace ChatController
//_ChatCode = "K2UPV-qrirb";
//_Benutzername = "lyndon";
//Password = "lyndon2travemünde";
_Kundennummer = "4368658436";
_ChatCode = "B7x0b-FhhJA";
_Benutzername = "jettenl";
Password = "n8-yR+3Q=6nX#";
#endif
}