public override void ToStream(Stream output)
        {
            output.Write(TLUtils.SignatureToBytes(Signature));
            Peer.ToStream(output);

            TopMessageId = TopMessageId ?? new TLInt(0);
            TopMessageId.ToStream(output);

            ReadInboxMaxId = ReadInboxMaxId ?? new TLInt(0);
            ReadInboxMaxId.ToStream(output);

            output.Write(UnreadCount.ToBytes());

            NotifySettings.NullableToStream(output);

            TopMessageRandomId = TopMessageRandomId ?? new TLLong(0);
            TopMessageRandomId.ToStream(output);

            With.NullableToStream(output);
            if (Messages != null)
            {
                var messages = new TLVector <TLMessageBase> {
                    Items = Messages
                };
                messages.ToStream(output);
            }
            else
            {
                var messages = new TLVector <TLMessageBase>();
                messages.ToStream(output);
            }
        }
Exemple #2
0
        public void CreateNotification(NotifySettings settings)
        {
            if (settings.IsEmpty)
            {
                return;
            }

            Intent intent = new Intent(NotificationContext, typeof(Activity_Main));

            intent.SetFlags(ActivityFlags.NewTask);

            if (settings.HasOnlyShifts)
            {
                intent.PutExtra(Activity_Main.BUNDLE_BOTTOMID_INTENT, Resource.Id.menu_shifts);
            }
            else
            {
                intent.PutExtra(Activity_Main.BUNDLE_BOTTOMID_INTENT, Resource.Id.menu_feed);
            }

            PendingIntent target = PendingIntent.GetActivity(NotificationContext, 0, intent, 0);

            var notify = new NotificationCompat.Builder(NotificationContext, CHANNEL_ID);

            notify.SetAutoCancel(true);
            notify.SetSmallIcon(Resource.Drawable.ic_stat_icon);
            notify.SetContentIntent(target);
            notify.SetContentTitle(NotificationContext.Resources.GetString(Resource.String.app_notify_title));
            notify.SetStyle(settings.GetInbox());

            var notificationManager = NotificationManagerCompat.From(NotificationContext);

            notificationManager.Notify(NOTIFICATION_ID, notify.Build());
        }
Exemple #3
0
        public override void ToStream(Stream output)
        {
            output.Write(TLUtils.SignatureToBytes(Signature));
            output.Write(Id.ToBytes());
            output.Write(Title.ToBytes());
            output.Write(Date.ToBytes());

            Participants.NullableToStream(output);
            NotifySettings.NullableToStream(output);
        }
 /// <summary>
 ///
 /// </summary>
 /// <param name="gameService"></param>
 /// <param name="userService"></param>
 /// <param name="directionProvider"></param>
 /// <param name="gameSettings"></param>
 /// <param name="gameAiSettings"></param>
 /// <param name="notifySettings"></param>
 /// <param name="castleTroopTypeService"></param>
 /// <param name="armySettingService"></param>
 public GameController(IGameService gameService, IUserService userService, IDirectionProvider directionProvider, GameSettings gameSettings, GameAiSettings gameAiSettings, NotifySettings notifySettings, ICastleTroopTypeService castleTroopTypeService, IGameArmySettingService armySettingService, ICastleDirectionService directionService)
 {
     _gameService            = gameService;
     _userService            = userService;
     _directionProvider      = directionProvider;
     _gameSettings           = gameSettings;
     _gameAiSettings         = gameAiSettings;
     _notifySettings         = notifySettings;
     _castleTroopTypeService = castleTroopTypeService;
     _armySettingService     = armySettingService;
     _directionService       = directionService;
     R = new Random();
 }
Exemple #5
0
        public override void ToStream(Stream output)
        {
            output.Write(TLUtils.SignatureToBytes(Signature));
            output.Write(Id.ToBytes());
            output.Write(Title.ToBytes());
            Photo.ToStream(output);
            output.Write(ParticipantsCount.ToBytes());
            output.Write(Date.ToBytes());
            //output.Write(Left.ToBytes());
            output.Write(Version.ToBytes());

            Participants.NullableToStream(output);
            NotifySettings.NullableToStream(output);

            CustomFlags.NullableToStream(output);
        }
Exemple #6
0
        public override void ToStream(Stream output)
        {
            try
            {
                output.Write(TLUtils.SignatureToBytes(Signature));

                output.Write(Flags.ToBytes());
                output.Write(Id.ToBytes());
                output.Write(AccessHash.ToBytes());
                output.Write(Title.ToBytes());
                if (IsSet(Flags, (int)ChannelFlags.Public))
                {
                    UserName.ToStream(output);
                }
                Photo.ToStream(output);
                Date.ToStream(output);
                Version.ToStream(output);

                CustomFlags.NullableToStream(output);

                ParticipantIds.NullableToStream(output);
                About.NullableToStream(output);
                ParticipantsCount.NullableToStream(output);
                AdminsCount.NullableToStream(output);
                KickedCount.NullableToStream(output);
                ReadInboxMaxId.NullableToStream(output);
                Pts.NullableToStream(output);
                Participants.NullableToStream(output);
                NotifySettings.NullableToStream(output);

                if (IsSet(CustomFlags, (int)ChannelCustomFlags.MigratedFromChatId))
                {
                    _migratedFromChatId.ToStream(output);
                }
                if (IsSet(CustomFlags, (int)ChannelCustomFlags.MigratedFromMaxId))
                {
                    _migratedFromMaxId.ToStream(output);
                }
            }
            catch (Exception ex)
            {
            }
        }
 Task <APIResult> CustomizeNotifySettings(NotifySettings settings)
 {
     throw new NotImplementedException();
 }
Exemple #8
0
 private static void InitSettings(NotifySettings settings)
 {
     settings.Name   = "Vita-Nex: Core Updates";
     settings.Access = UpdateService.CSOptions.NotifyAccess;
 }
 public void Stop()
 {
     NotifySettings.Unsubscribe(CacheNotifyAction.Insert);
     NotifySettings.Unsubscribe(CacheNotifyAction.Insert);
 }
 public void Start()
 {
     NotifySettings.Subscribe((n) => StartEncryption(n), CacheNotifyAction.Insert);
     NotifyStop.Subscribe((n) => StopEncryption(), CacheNotifyAction.Insert);
 }
Exemple #11
0
 private static void InitSettings(NotifySettings settings)
 {
     settings.Name      = "Cure Winner";
     settings.CanIgnore = true;
 }
Exemple #12
0
 private static void InitSettings(NotifySettings settings)
 {
     settings.Name      = "Advertising Reports";
     settings.CanIgnore = true;
     settings.Access    = AntiAdverts.Access;
 }
 private static void InitSettings(NotifySettings settings)
 {
     settings.Name      = "Creature Deaths";
     settings.CanIgnore = true;
 }
Exemple #14
0
 private static void InitSettings(NotifySettings settings)
 {
     settings.Name      = "Conquests";
     settings.CanIgnore = true;
 }
Exemple #15
0
        private async Task <Negotiator> NotificationSettings()
        {
            var s = await NotifySettings.GetSettingsAsync();

            return(View["NotificationSettings", s]);
        }
Exemple #16
0
 private static void InitSettings(NotifySettings settings)
 {
     settings.Name      = "PvP Battles";
     settings.CanIgnore = true;
 }
Exemple #17
0
 private static void InitSettings(NotifySettings settings)
 {
     settings.Name      = "Era Updates";
     settings.CanIgnore = true;
 }