Browse Source

Replies prefix

master
Julio Biason 15 years ago
parent
commit
6fe8b283e4
  1. 8
      issues/issue-f765c17cfc7491492564797ce7612053453eea8c.yaml
  2. 8
      issues/issue-fc295a72e8c2767cc17ac76830e1286430c77d48.yaml
  3. 4
      mitterlib/network/__init__.py
  4. 6
      mitterlib/network/networkbase.py
  5. 4
      mitterlib/network/twitter.py
  6. 5
      mitterlib/ui/ui_pygtk.py

8
issues/issue-f765c17cfc7491492564797ce7612053453eea8c.yaml

@ -7,8 +7,8 @@ type: :feature
component: network
release: 1.0.0
reporter: Julio Biason <julio.biason@gmail.com>
status: :unstarted
disposition:
status: :closed
disposition: :fixed
creation_time: 2009-12-22 12:31:41.160379 Z
references: []
@ -18,3 +18,7 @@ log_events:
- Julio Biason <julio.biason@gmail.com>
- created
- ""
- - 2009-12-25 15:37:10.805041 Z
- Julio Biason <julio.biason@gmail.com>
- closed with disposition fixed
- added.

8
issues/issue-fc295a72e8c2767cc17ac76830e1286430c77d48.yaml

@ -5,8 +5,8 @@ type: :feature
component: pygtk
release: 1.0.0
reporter: Julio Biason <julio.biason@gmail.com>
status: :unstarted
disposition:
status: :closed
disposition: :fixed
creation_time: 2009-12-22 12:33:43.272350 Z
references:
- network-2
@ -20,3 +20,7 @@ log_events:
- Julio Biason <julio.biason@gmail.com>
- added reference 1
- ""
- - 2009-12-25 15:37:26.149895 Z
- Julio Biason <julio.biason@gmail.com>
- closed with disposition fixed
- ""

4
mitterlib/network/__init__.py

@ -200,6 +200,10 @@ class Networks(object):
data.network = network
return data
def reply_prefix(self, message):
"""Return the prefix to be used in the reply for that message."""
return self.networks[message.network].reply_prefix(message)
def replies(self, network=None):
"""Return a list of NetworkData objects for the replies for the user
messages."""

6
mitterlib/network/networkbase.py

@ -216,6 +216,12 @@ class NetworkBase(object):
# anyway?
return None
def reply_prefix(self, message):
"""Return the prefix to be used in case the user requests a reply for
that message. *message* must be a :class:`NetworkData` object. Returns
a string."""
return ''
def repost(self, message):
"""Repost a message in your current timeline. *message* must be a
valid :class:`NetworkData` object. Must return the id of the new

4
mitterlib/network/twitter.py

@ -352,6 +352,10 @@ class Connection(NetworkBase):
response = self._request('/statuses/show/%d.json' % (message_id))
return TwitterNetworkData(response)
def reply_prefix(self, message):
"""Returns the prefix needed for a reply."""
return '@' + message.username + ' '
def replies(self):
"""Return a list of NetworkData objects for the replies for the user
messages."""

5
mitterlib/ui/ui_pygtk.py

@ -893,8 +893,9 @@ class Interface(object):
"""Reply to someone else's message."""
(model, iter) = self._grid.get_selection().get_selected()
message = model.get_value(iter, 0)
self._reply_label.set_text('Replying to %s' % (message.username))
self._update_text.get_buffer().set_text(
self._connection.reply_prefix(message))
#self._reply_label.set_text('Replying to %s' % (message.username))
self._reply_message_id = message
self._update_text.grab_focus()

Loading…
Cancel
Save