示例#1
0
        private async Task UpdateUserSettings()
        {
            if (_updateInProgress)
            {
                return;
            }

            // LOCK ON THIS
            _updateInProgress = true;

            logger.debug("Synchronizing settings");
            try {
                InputPeerNotifySettings newSettings = TL.inputPeerNotifySettings(peerNotifySettings.mute_until,
                                                                                 peerNotifySettings.sound, peerNotifySettings.show_previews, peerNotifySettings.events_mask);

                // FIXME: catch exception, process BOOl error
                bool update = await TelegramSession.Instance.Api.account_updateNotifySettings(TL.inputNotifyPeer
                                                                                                  (TL.inputPeerContact(Id)), newSettings);

                logger.debug("Synchronized settings: " + update);
            }
            catch (MTProtoException ex) {
                logger.error("UpdateUserSettings Exception");
            }
            // UNLOCK ON THIS
            _updateInProgress = false;
        }