diff --git a/Push/Classes/PushManager.cs b/Push/Classes/PushManager.cs index 2dc238f6..e2c9677e 100644 --- a/Push/Classes/PushManager.cs +++ b/Push/Classes/PushManager.cs @@ -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; @@ -79,7 +80,11 @@ private ushort GetServerPort() /// private static int GetAccountsHash() { - IEnumerable accounts = ConnectionHandler.INSTANCE.GetClients().Select(x => x.client.dbAccount.bareJid); + List 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(); }