private async Task GetUserSettings() {
if (_getInProgress)
return;
_getInProgress = true;
// FIXME: catch exception
await TelegramSession.Instance.Established;
try {
PeerNotifySettings settings =
await
TelegramSession.Instance.Api.account_getNotifySettings(
TL.inputNotifyPeer(TL.inputPeerContact(Id)));
switch (settings.Constructor) {
case Constructor.peerNotifySettings:
UpdatePeerNotifySettings(settings as PeerNotifySettingsConstructor);
break;
case Constructor.peerNotifySettingsEmpty:
logger.error("Unable to get USER settings: Constructor.peerNotifySettingsEmpty");
break;
}
} catch (MTProtoException ex) {
logger.error("GetUserSettings Exception");
}
_getInProgress = false;
}