// Token: 0x06000BED RID: 3053 RVA: 0x00052DC4 File Offset: 0x00050FC4 internal static void SerializeMailTips(MailTips mailTips, MailTipsState mailTipsState, StringBuilder stringBuilder) { stringBuilder.Append("'"); stringBuilder.Append(Utilities.JavascriptEncode(mailTips.EmailAddress.Address)); stringBuilder.Append("' : "); stringBuilder.Append("{"); stringBuilder.Append("'iSize' : "); stringBuilder.Append(mailTips.TotalMemberCount); stringBuilder.Append(", "); stringBuilder.Append("'iExternalSize' : "); stringBuilder.Append(mailTips.ExternalMemberCount); if (!string.IsNullOrEmpty(mailTips.CustomMailTip)) { stringBuilder.Append(", "); stringBuilder.Append("'sCustomTip' : '"); stringBuilder.Append(Utilities.JavascriptEncode(Utilities.RemoveHtmlComments(mailTips.CustomMailTip))); stringBuilder.Append("'"); } if (!string.IsNullOrEmpty(mailTips.OutOfOfficeMessage)) { stringBuilder.Append(", "); stringBuilder.Append("'sAutoReplyMessage' : '"); stringBuilder.Append(Utilities.JavascriptEncode(Utilities.RemoveHtmlComments(mailTips.OutOfOfficeMessage))); stringBuilder.Append("'"); } if (mailTips.OutOfOfficeDuration != null && DateTime.MinValue != mailTips.OutOfOfficeDuration.EndTime) { stringBuilder.Append(", "); stringBuilder.Append("'sAutoReplyEndDate' : '"); ExDateTime exDateTime = new ExDateTime(mailTipsState.LogonUserTimeZone, mailTips.OutOfOfficeDuration.EndTime); stringBuilder.Append(Utilities.JavascriptEncode(exDateTime.ToString(mailTipsState.WeekdayDateTimeFormat, mailTipsState.LogonUserCulture))); stringBuilder.Append("'"); } if (mailTips.IsModerated) { stringBuilder.Append(", "); stringBuilder.Append("'fModerated' : 1"); } if (mailTips.MailboxFull) { stringBuilder.Append(", "); stringBuilder.Append("'fFull' : 1"); } if (null != mailTipsState.SendingAs && !string.IsNullOrEmpty(mailTipsState.SendingAs.AddressString)) { stringBuilder.Append(", "); stringBuilder.Append("'oRestricted' : {'"); stringBuilder.Append(Utilities.JavascriptEncode(mailTipsState.SendingAs.AddressString)); stringBuilder.Append("' : "); stringBuilder.Append(mailTips.DeliveryRestricted ? "1}" : "0}"); } if (mailTips.Exception != null) { stringBuilder.Append(", "); stringBuilder.Append("'fErrored' : 1"); } stringBuilder.Append("}"); }
public async Task GetOutOfOfficeAsync(IEnumerable <GraphUser> users) { var authToken = Settings.TokenForUser; if (string.IsNullOrEmpty(authToken) || users == null || !users.Any()) { return; } try { UriBuilder builder = new UriBuilder(AppSettings.GraphApiEndpoint); builder.Path = $"beta/me/getMailTips"; string uri = builder.ToString(); var mailTips = new MailTips { EmailAddresses = users .Where(x => !string.IsNullOrEmpty(x.Mail)) .Select(x => x.Mail) .ToArray(), MailTipsOptions = "automaticReplies" }; var result = await _requestProvider .PostAsync <MailTips, RootGraphObject>(uri, mailTips, authToken); foreach (var response in result?.MailTips) { if (!string.IsNullOrEmpty(response?.AutomaticReplies?.Message) && !string.IsNullOrEmpty(response?.EmailAddress?.Address)) { // if {response.EmailAddress.Address} Its out of office var user = users.FirstOrDefault(x => response.EmailAddress.Address.Equals(x.Mail)); user.OOF = true; } } } catch (Exception e) { System.Diagnostics.Debug.WriteLine($"Error getting OOF {e}"); } }