|
|
|
@ -172,16 +172,19 @@ class Networks(object):
|
|
|
|
|
|
|
|
|
|
def reply_prefix(self, message): |
|
|
|
|
"""Return the prefix to be used in the reply for that message.""" |
|
|
|
|
assert(isinstance(message, NetworkData)) |
|
|
|
|
return self.networks[message.network].reply_prefix(message) |
|
|
|
|
|
|
|
|
|
def repost(self, message): |
|
|
|
|
"""Repost a message in the user's timeline. The network used is |
|
|
|
|
the same in the message.""" |
|
|
|
|
assert(isinstance(message, NetworkData)) |
|
|
|
|
self.networks[message.network].repost(message) |
|
|
|
|
return |
|
|
|
|
|
|
|
|
|
def favourite(self, message): |
|
|
|
|
"""Change the favourite status of the message.""" |
|
|
|
|
assert(isinstance(message, NetworkData)) |
|
|
|
|
self.networks[message.network].favourite(message) |
|
|
|
|
return |
|
|
|
|
|
|
|
|
@ -208,6 +211,7 @@ class Networks(object):
|
|
|
|
|
|
|
|
|
|
def link(self, message): |
|
|
|
|
"""Returns a link directly to the message.""" |
|
|
|
|
assert(isinstance(message, NetworkData)) |
|
|
|
|
return self.networks[message.network].link(message) |
|
|
|
|
|
|
|
|
|
def replies(self, network=None): |
|
|
|
@ -231,21 +235,23 @@ class Networks(object):
|
|
|
|
|
|
|
|
|
|
def can_delete(self, message): |
|
|
|
|
"""Return True if the message can be deleted; False otherwise.""" |
|
|
|
|
assert(isinstance(message, NetworkData)) |
|
|
|
|
return self.networks[message.network].can_delete(message) |
|
|
|
|
|
|
|
|
|
def can_reply(self, message): |
|
|
|
|
"""Return True if the message can be replied; False otherwise.""" |
|
|
|
|
assert(isinstance(message, NetworkData)) |
|
|
|
|
return self.networks[message.network].can_reply(message) |
|
|
|
|
|
|
|
|
|
def can_repost(self, message): |
|
|
|
|
"""Return True if the message can be resposted; False otherwise.""" |
|
|
|
|
assert(isinstance(message, NetworkData)) |
|
|
|
|
return self.networks[message.network].can_repost(message) |
|
|
|
|
|
|
|
|
|
def can_favourite(self, message): |
|
|
|
|
"""Return True if the message can be favourited/unfavourited; False |
|
|
|
|
otherwise.""" |
|
|
|
|
assert(isinstance(message, NetworkData)) |
|
|
|
|
return self.networks[message.network].can_favourite(message) |
|
|
|
|
|
|
|
|
|
# TODO: Function to return a regexp for usernames |
|
|
|
|
# TODO: Function to return a pre-message for replies (how to handle |
|
|
|
|
# dynamic content, like usernames?) |
|
|
|
|