Пример #1
0
        public async Task WereDeletedEvent(int stargateChannel, IEnumerable <Device> devices, KahlaUser trigger)
        {
            var token = await _appsContainer.AccessToken();

            var wereDeletedEvent = new WereDeletedEvent
            {
                Trigger = trigger
            };

            if (stargateChannel != -1)
            {
                await _stargatePushService.PushMessageAsync(token, stargateChannel, JsonConvert.SerializeObject(wereDeletedEvent), true);
            }
            await _thirdPartyPushService.PushAsync(devices, "*****@*****.**", JsonConvert.SerializeObject(wereDeletedEvent));
        }
Пример #2
0
        public async Task WereDeletedEvent(KahlaUser receiver, KahlaUser trigger)
        {
            var token = await _appsContainer.AccessToken();

            var channel          = receiver.CurrentChannel;
            var wereDeletedEvent = new WereDeletedEvent
            {
                Trigger = trigger
            };

            if (channel != -1)
            {
                await _stargatePushService.PushMessageAsync(token, channel, _Serialize(wereDeletedEvent), true);
            }
            await _thirdPartyPushService.PushAsync(receiver.Id, "*****@*****.**", _Serialize(wereDeletedEvent));
        }
        public async Task WereDeletedEvent(string recieverId)
        {
            var token = AppsContainer.AccessToken();
            var user  = await _dbContext.Users.FindAsync(recieverId);

            var channel = user.CurrentChannel;
            var nevent  = new WereDeletedEvent
            {
                Type = EventType.WereDeletedEvent
            };

            if (channel != -1)
            {
                await _pushMessageService.PushMessageAsync(await token(), channel, _CammalSer(nevent), true);
            }
        }
        public async Task WereDeletedEvent(string recieverId)
        {
            var token = await _appsContainer.AccessToken();

            var user = await _dbContext.Users.FindAsync(recieverId);

            var channel = user.CurrentChannel;
            var nevent  = new WereDeletedEvent
            {
                Type = EventType.WereDeletedEvent
            };

            if (channel != -1)
            {
                await _stargatePushService.PushMessageAsync(token, channel, _Serialize(nevent), true);
            }
            await _thirdPartyPushService.PushAsync(user.Id, "*****@*****.**", _Serialize(nevent));
        }