Ejemplo n.º 1
0
        public Recipient GetRecipientForNumber(string number)
        {
            var query = conn.Table<Recipient>().Where(r => r.Number == number);

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

            var recipient = new Recipient()
            {
                Number = number
            };

            conn.Insert(recipient);

            return recipient;
        }
Ejemplo n.º 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;
        }
Ejemplo n.º 3
0
 private IdentityKeyMismatch GetKeyMismatch(Recipient r)
 {
     var keyMismatches = Message.MismatchedIdentities;
     return keyMismatches.FirstOrDefault(identityMismatch => identityMismatch.RecipientId.Equals(r.RecipientId));
 }
Ejemplo n.º 4
0
 public Recipients(Recipient recipient) // TODO ???
     :this(new List<Recipient>() { recipient }, null)
 {
 }
Ejemplo n.º 5
0
        private void Update(Recipient recipient)
        {

        }