Example #1
0
        public void ClearRecentStickers()
        {
            IsWorking = true;
            MTProtoService.ClearRecentStickersAsync(
                false,
                result => Execute.BeginOnUIThread(() =>
            {
                IsWorking = false;
                MTProtoService.SetMessageOnTime(2.0, AppResources.Done);

                var allStickers = StateService.GetAllStickers();
                if (allStickers != null)
                {
                    var allStickers29 = allStickers as TLAllStickers29;
                    if (allStickers29 != null)
                    {
                        allStickers29.RecentlyUsed = new TLVector <TLRecentlyUsedSticker>();
                        EmojiControl emojiControl;
                        if (EmojiControl.TryGetInstance(out emojiControl))
                        {
                            emojiControl.ClearRecentStickers();
                        }
                        StateService.SaveAllStickersAsync(allStickers29);
                    }
                }
            }),
                error => Execute.BeginOnUIThread(() =>
            {
                IsWorking = false;
                Execute.ShowDebugMessage("messages.clearRecentStickers error " + error);
            }));
        }