Skip to content
This repository has been archived by the owner on Jan 29, 2024. It is now read-only.

Commit

Permalink
Fixed loading accounts when initializing push
Browse files Browse the repository at this point in the history
  • Loading branch information
COM8 committed Jul 27, 2021
1 parent a4e2bd8 commit e5ec6b3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Push/Classes/PushManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using Push.Classes.Events;
using Push.Classes.Messages;
using Storage.Classes;
using Storage.Classes.Contexts;
using Windows.Networking.PushNotifications;
using XMPP_API.Classes.Network;
using XMPP_API.Classes.Network.TCP;
Expand Down Expand Up @@ -79,7 +80,11 @@ private ushort GetServerPort()
/// </summary>
private static int GetAccountsHash()
{
IEnumerable<string> accounts = ConnectionHandler.INSTANCE.GetClients().Select(x => x.client.dbAccount.bareJid);
List<string> accounts;
using (MainDbContext ctx = new MainDbContext())
{
accounts = ctx.Accounts.Select(a => a.bareJid).ToList();
}
// The last bit always indicates push enabled:
return unchecked(GetOrderIndependentHashCode(accounts) << 1) ^ Settings.GetSettingBoolean(SettingsConsts.PUSH_ENABLED).GetHashCode();
}
Expand Down

0 comments on commit e5ec6b3

Please sign in to comment.