示例#1
0
        protected bool AddMessageRecipients(RecipientCollection recipients, RecipientItemType recipientItemType, string wellName)
        {
            bool flag = false;

            this.Writer.Write("<div id=\"");
            this.Writer.Write(wellName);
            this.Writer.Write("\">");
            RecipientInfo[] array = (RecipientInfo[])base.GetParameter(wellName);
            if (array == null)
            {
                this.Writer.Write("</div>");
                return(false);
            }
            List <Participant> list = new List <Participant>();

            foreach (RecipientInfo recipientInfo in array)
            {
                flag |= base.GetExchangeParticipantsFromRecipientInfo(recipientInfo, list);
            }
            for (int j = 0; j < list.Count; j++)
            {
                recipients.Add(list[j], recipientItemType);
            }
            this.Writer.Write("</div>");
            return(flag);
        }
 // Token: 0x06000115 RID: 277 RVA: 0x0000710C File Offset: 0x0000530C
 private static void CloneSmsItem(MailboxSession session, MessageItem source, MailboxData mailboxData, Recipient recipient, ConversationIndex conversationIndex)
 {
     using (MessageItem messageItem = MessageItem.CloneMessage(session, StoreObjectId.FromProviderSpecificId(mailboxData.SentItemsFolderId), source))
     {
         RecipientCollection recipients = messageItem.Recipients;
         recipients.Clear();
         recipients.Add(recipient);
         SentItemsProcessor.SaveSmsItem(messageItem, conversationIndex);
     }
 }
示例#3
0
        private object ConvertRecipientCollectionFromString(object value)
        {
            string recipientString = (string)value;

            string[] recipients = recipientString.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries);

            RecipientCollection recipientCollection = new RecipientCollection();
            for (int i = 0; i < recipients.Length; i++)
            {
                recipientCollection.Add(Int32.Parse(recipients[i]));
            }

            return recipientCollection;
        }
        public override object ConvertFrom(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value)
        {
            string recipientString = (string)value;

            string[] recipients = recipientString.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries);

            RecipientCollection recipientCollection = new RecipientCollection();
            for (int i = 0; i < recipients.Length; i++)
            {
                recipientCollection.Add(Int32.Parse(recipients[i]));
            }

            return recipientCollection;
        }
示例#5
0
        public override object ConvertFrom(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value)
        {
            string recipientString = (string)value;

            string[] recipients = recipientString.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries);

            RecipientCollection recipientCollection = new RecipientCollection();

            for (int i = 0; i < recipients.Length; i++)
            {
                recipientCollection.Add(Int32.Parse(recipients[i]));
            }

            return(recipientCollection);
        }
示例#6
0
        private object ConvertRecipientCollectionFromString(object value)
        {
            string recipientString = (string)value;

            string[] recipients = recipientString.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries);

            RecipientCollection recipientCollection = new RecipientCollection();

            for (int i = 0; i < recipients.Length; i++)
            {
                recipientCollection.Add(Int32.Parse(recipients[i]));
            }

            return(recipientCollection);
        }
 public static void SetRecipientCollection(RecipientCollection collection, RecipientItemType recipientItemType, string textString)
 {
     if (collection == null)
     {
         throw new ArgumentNullException("Recipient collection null");
     }
     if (textString == null)
     {
         throw new ArgumentNullException("Recipient string null");
     }
     string[] array = ParseRecipientHelper.ParseRecipientChunk(textString);
     EmailAddressConverter.ClearRecipients(collection, recipientItemType);
     for (int i = 0; i < array.Length; i++)
     {
         if (!string.IsNullOrEmpty(array[i]))
         {
             Participant participant = Participant.Parse(array[i]);
             EmailAddressConverter.ValidateParticipant(participant);
             collection.Add(participant, recipientItemType);
         }
     }
 }
        // Token: 0x06000114 RID: 276 RVA: 0x00006EAC File Offset: 0x000050AC
        private static void HandleSmsMessage(MailboxSession session, Item item, MailboxData mailboxData, ConversationIndexTrackingEx indexTrackingEx)
        {
            MessageItem messageItem = item as MessageItem;

            if (messageItem == null)
            {
                SentItemsProcessor.Tracer.TraceDebug(0L, "{0}: the SMS message is not MessageItem", new object[]
                {
                    TraceContext.Get()
                });
                return;
            }
            RecipientCollection recipients = messageItem.Recipients;

            if (recipients.Count == 0)
            {
                return;
            }
            using (SmsRecipientInfoCache smsRecipientInfoCache = SmsRecipientInfoCache.Create(session, SentItemsProcessor.Tracer))
            {
                Dictionary <ConversationIndex, Recipient> dictionary = new Dictionary <ConversationIndex, Recipient>(recipients.Count);
                for (int i = recipients.Count - 1; i >= 0; i--)
                {
                    Recipient   recipient   = recipients[i];
                    Participant participant = recipient.Participant;
                    if (!(participant == null) && !string.IsNullOrEmpty(participant.EmailAddress))
                    {
                        string text = null;
                        if (string.Equals(participant.RoutingType, "MOBILE", StringComparison.OrdinalIgnoreCase))
                        {
                            text = participant.EmailAddress;
                            smsRecipientInfoCache.AddRecipient(participant);
                        }
                        else if (string.Equals(participant.RoutingType, "SMTP", StringComparison.OrdinalIgnoreCase))
                        {
                            ProxyAddress proxyAddress;
                            if (SmtpProxyAddress.TryDeencapsulate(participant.EmailAddress, out proxyAddress) && string.Equals(proxyAddress.PrefixString, "MOBILE", StringComparison.OrdinalIgnoreCase))
                            {
                                text = proxyAddress.AddressString;
                            }
                            smsRecipientInfoCache.AddRecipient(new Participant(participant.DisplayName, text, "MOBILE"));
                        }
                        if (text != null)
                        {
                            ConversationIndex conversationIndex = ConversationIndex.GenerateFromPhoneNumber(text);
                            if (!(conversationIndex == ConversationIndex.Empty))
                            {
                                recipients.RemoveAt(i);
                                if (!dictionary.ContainsKey(conversationIndex))
                                {
                                    dictionary.Add(conversationIndex, recipient);
                                }
                            }
                        }
                    }
                }
                if (recipients.Count > 0)
                {
                    messageItem.Save(SaveMode.ResolveConflicts);
                    messageItem.Load();
                }
                int num = 0;
                foreach (KeyValuePair <ConversationIndex, Recipient> keyValuePair in dictionary)
                {
                    num++;
                    AggregationBySmsItemClassProcessor.ChunkSmsConversation(XSOFactory.Default, session, keyValuePair.Key, indexTrackingEx);
                    if (num < dictionary.Count || recipients.Count > 0)
                    {
                        SentItemsProcessor.CloneSmsItem(session, messageItem, mailboxData, keyValuePair.Value, keyValuePair.Key);
                    }
                    else
                    {
                        recipients.Add(keyValuePair.Value);
                        SentItemsProcessor.SaveSmsItem(messageItem, keyValuePair.Key);
                        messageItem.Load();
                    }
                }
                smsRecipientInfoCache.Commit();
            }
        }