From: Marek Marecki Date: Mon, 10 Jun 2013 21:43:24 +0000 (+0200) Subject: `Notification().who()` now returns list of guids af all users mentioned X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=19a4a78a132cbf96ed4a899f78a2147015337447;p=diaspy.git `Notification().who()` now returns list of guids af all users mentioned in notification (not only first one). --- diff --git a/diaspy/models.py b/diaspy/models.py index 25ad16d..ec798cc 100644 --- a/diaspy/models.py +++ b/diaspy/models.py @@ -82,16 +82,14 @@ class Notification(): return '{0}: {1}'.format(self.when(), str(self)) def who(self): - """Returns guid of user who caused you to get the notification. + """Returns list of guids of the users who caused you to get the notification. """ - who = self._who_regexp.search(self.data['note_html']).group(0) - return who[8:24] + return [who[8:24] for who in self._who_regexp.findall(self.data['note_html'])] def when(self): """Returns UTC time as found in note_html. """ - when = self._when_regexp.search(self.data['note_html']).group(0) - return when + return self._when_regexp.search(self.data['note_html']).group(0) def mark(self, unread=False): """Marks notification to read/unread. diff --git a/manual/notifications.mdown b/manual/notifications.mdown index 7f0d6e7..057f7ae 100644 --- a/manual/notifications.mdown +++ b/manual/notifications.mdown @@ -12,7 +12,7 @@ Single notification (it should be obvious that it requires object of its own) is ##### 1. `who()` -This method will return guid of a user who caused you to get this notification. +This method will return list of guids of the users who caused you to get this notification. ##### 2. `when()`