Example #1
0
        public Recipients GetOrCreateRecipients(TextSecureDirectory.Directory d)
        {
            var recipients = new List <Recipient>();

            /*foreach (var recipientId in recipientIds)
             * {
             *
             * }*/

            recipients.Add(GetOrCreateRecipient(d));

            return(RecipientFactory.getRecipientsFor(recipients, false));
        }
Example #2
0
        public Recipient GetOrCreateRecipient(TextSecureDirectory.Directory d)
        {
            var query = conn.Table <Recipient>().Where(r => r.Number == d.Number);

            if (query.Count() != 0)
            {
                return(query.First());
            }

            var recipient = new Recipient()
            {
                RecipientId = 0,
                Number      = d.Number,
                ContactId   = d.ContactId,
                Name        = d.Name
            };

            conn.Insert(recipient);

            return(recipient);
        }