diff --git a/weboob/backends/aum/backend.py b/weboob/backends/aum/backend.py index f4232d69..70e3331a 100644 --- a/weboob/backends/aum/backend.py +++ b/weboob/backends/aum/backend.py @@ -330,7 +330,7 @@ class AuMBackend(BaseBackend, ICapMessages, ICapMessagesPost, ICapDating, ICapCh contact.name = profile.get_name() contact.status = s else: - contact = Contact(_id, profile.get_name(), s) + contact = Contact(_id, profile.get_name(), s, self.browser.id2url(_id)) contact.status_msg = profile.get_status() contact.summary = profile.description for photo in profile.photos: @@ -367,7 +367,7 @@ class AuMBackend(BaseBackend, ICapMessages, ICapMessagesPost, ICapDating, ICapCh continue # TODO age in contact['birthday'] - c = Contact(contact['id'], contact['pseudo'], s) + c = Contact(contact['id'], contact['pseudo'], s, self.browser.id2url(contact['id'])) c.status_msg = u'%s old' % contact['birthday'] c.set_photo(contact['cover'].split('/')[-1].replace('thumb0_', 'image'), thumbnail_url=contact['cover']) yield c diff --git a/weboob/backends/aum/browser.py b/weboob/backends/aum/browser.py index 8ab810ce..7a415d4c 100644 --- a/weboob/backends/aum/browser.py +++ b/weboob/backends/aum/browser.py @@ -89,6 +89,9 @@ class AuMBrowser(BaseBrowser): BaseBrowser.__init__(self, *args, **kwargs) self.my_id = 0 + def id2url(self, _id): + return u'%s://%s/%s' % (self.PROTOCOL, self.DOMAIN, _id) + def login(self): if not self.is_on_page(LoginPage): self.home() diff --git a/weboob/capabilities/contact.py b/weboob/capabilities/contact.py index 0775fc82..740c8100 100644 --- a/weboob/capabilities/contact.py +++ b/weboob/capabilities/contact.py @@ -59,10 +59,11 @@ class Contact(CapBaseObject): STATUS_OFFLINE = 0x004 STATUS_ALL = 0xfff - def __init__(self, id, name, status): + def __init__(self, id, name, status, url): CapBaseObject.__init__(self, id) self.add_field('name', basestring, name) self.add_field('status', int, status) + self.add_field('url', basestring, url) self.add_field('status_msg', basestring) self.add_field('summary', basestring) self.add_field('photos', dict, OrderedDict())