Example #1
0
 def process_update(self, msg, payload):
     """Process a contact update message."""
     # XXX validate payload structure
     if 'user_id' not in payload or 'contact_id' not in payload:
         raise Exception('Invalid contact_update structure')
     user = User.get(payload['user_id'])
     contact = Contact(user.user_id, contact_id=payload['contact_id'])
     contact.get_db()
     contact.unmarshall_db()
     qualifier = ContactMessageQualifier(user)
     log.info('Will process update for contact {0} of user {1}'.format(
         contact.contact_id, user.user_id))
     qualifier.process(contact)
Example #2
0
 def process_update(self, msg, payload):
     """Process a contact update message."""
     # XXX validate payload structure
     if 'user_id' not in payload or 'contact_id' not in payload:
         raise Exception('Invalid contact_update structure')
     user = User.get(payload['user_id'])
     contact = Contact(user, contact_id=payload['contact_id'])
     contact.get_db()
     contact.unmarshall_db()
     qualifier = ContactMessageQualifier(user)
     log.info('Will process update for contact {0} of user {1}'.
              format(contact.contact_id, user.user_id))
     # TODO: (re)discover GPG keys
     qualifier.process(contact)
Example #3
0
def basic_compute(username, job, **kwargs):
    """Import emails for an user."""
    from caliopen_main.user.core import User
    from caliopen_main.contact.objects import Contact
    from caliopen_pi.qualifiers import ContactMessageQualifier

    user = User.by_name(username)
    qualifier = ContactMessageQualifier(user)
    contacts = Contact.list_db(user.user_id)

    if job == 'contact_privacy':
        for contact in contacts:
            log.info('Processing contact {0}'.format(contact.contact_id))
            qualifier.process(contact)
Example #4
0
def basic_compute(username, job, ** kwargs):
    """Import emails for an user."""
    from caliopen_main.user.core import User
    from caliopen_main.contact.objects import Contact
    from caliopen_pi.qualifiers import ContactMessageQualifier

    user = User.by_name(username)
    qualifier = ContactMessageQualifier(user)
    contacts = Contact.list_db(user.user_id)

    if job == 'contact_privacy':
        for contact in contacts:
            log.info('Processing contact {0}'.format(contact.contact_id))
            qualifier.process(contact)