Browse Source

Repost works

master
Julio Biason 15 years ago
parent
commit
7d1b474086
  1. 10
      mitterlib/network/twitter.py
  2. 9
      mitterlib/ui/ui_pygtk.py

10
mitterlib/network/twitter.py

@ -133,7 +133,8 @@ class TwitterNetworkData(NetworkData):
# Twitter encodes a lot of HTML entities, which are not good when
# you want to *display* then (e.g., "<" returns to us as "&lt;").
# So we convert this here.
# So we convert this here. Interfaces need to worry about converting
# them if it becomes a problem.
self.message = _unhtml(data['text'])
return
@ -405,8 +406,9 @@ class Connection(NetworkBase):
def repost(self, message):
"""Repost a message."""
body = {'id': message.id} # Force a body to make it a POST.
data = self._request('/statuses/retweet.json', body=body)
body = urllib.urlencode({'id': message.id})
resource = '/statuses/retweet/%d.json' % (message.id)
data = self._request(resource, body=body)
return TwitterNetworkData(data)
def delete_message(self, message):
@ -435,4 +437,4 @@ class Connection(NetworkBase):
def can_repost(self, message):
"""Twitter ignores retweets from the user."""
return not (message.username ==
self._options[self.NAMESPACE]['username'])
self._options[self.NAMESPACE]['username'])

9
mitterlib/ui/ui_pygtk.py

@ -638,12 +638,6 @@ class Interface(object):
self._reply_label.set_text('')
return
def _clear_repost(self):
"""Clear the info about a repost."""
self._repost_message_id = None
self._reply_label.set_text('')
return
# ------------------------------------------------------------
# Widget callback functions
# ------------------------------------------------------------
@ -683,7 +677,6 @@ class Interface(object):
self._delete_iter = None
self._clear_reply()
self._clear_repost()
return
@ -882,7 +875,6 @@ class Interface(object):
self._clear_text(None)
self._update_statusbar('Your status was updated.')
self._clear_reply()
self._clear_repost()
return
def _exception_update_status(self, widget, exception):
@ -954,7 +946,6 @@ class Interface(object):
# interthread communication.
self._delete_iter = None
self._reply_message_id = None
self._repost_message_id = None
return

Loading…
Cancel
Save