|
|
@ -39,7 +39,6 @@ from mitterlib.ui.helpers import timesince |
|
|
|
# Constants |
|
|
|
# Constants |
|
|
|
|
|
|
|
|
|
|
|
_log = logging.getLogger('ui.pygtk') |
|
|
|
_log = logging.getLogger('ui.pygtk') |
|
|
|
|
|
|
|
|
|
|
|
URL_RE = re.compile(r'(https?://[^\s\n\r]+)', re.I) |
|
|
|
URL_RE = re.compile(r'(https?://[^\s\n\r]+)', re.I) |
|
|
|
|
|
|
|
|
|
|
|
# ---------------------------------------------------------------------- |
|
|
|
# ---------------------------------------------------------------------- |
|
|
@ -52,14 +51,16 @@ N_ = t.ngettext |
|
|
|
# ---------------------------------------------------------------------- |
|
|
|
# ---------------------------------------------------------------------- |
|
|
|
# String with the format to the message |
|
|
|
# String with the format to the message |
|
|
|
# ---------------------------------------------------------------------- |
|
|
|
# ---------------------------------------------------------------------- |
|
|
|
MESSAGE_FORMAT = '%(favourite_star)s' \ |
|
|
|
MESSAGE_FORMAT = ('%(favourite_star)s' |
|
|
|
'<b>%(full_name)s</b> ' \ |
|
|
|
'<b>%(full_name)s</b> ' |
|
|
|
'<small>(%(username)s' \ |
|
|
|
'<small>(%(username)s' |
|
|
|
'%(message_type)s' \ |
|
|
|
'%(message_type)s' |
|
|
|
')</small>:' \ |
|
|
|
')</small>:' |
|
|
|
'%(read_status)s\n' \ |
|
|
|
'%(read_status)s ' |
|
|
|
'%(message)s\n' \ |
|
|
|
'%(protected_status)s ' |
|
|
|
'<small>%(message_age)s</small>' |
|
|
|
'\n' |
|
|
|
|
|
|
|
'%(message)s\n' |
|
|
|
|
|
|
|
'<small>%(message_age)s</small>') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# ---------------------------------------------------------------------- |
|
|
|
# ---------------------------------------------------------------------- |
|
|
@ -626,6 +627,12 @@ class Interface(object): |
|
|
|
info.append(_(' — <i>in reply to %s</i>') % |
|
|
|
info.append(_(' — <i>in reply to %s</i>') % |
|
|
|
(data.parent_owner)) |
|
|
|
(data.parent_owner)) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if data.protected: |
|
|
|
|
|
|
|
message_values['protected_status'] = ( |
|
|
|
|
|
|
|
self._options[self.NAMESPACE]['protected_char']) |
|
|
|
|
|
|
|
else: |
|
|
|
|
|
|
|
message_values['protected_status'] = '' |
|
|
|
|
|
|
|
|
|
|
|
message_values['message_type'] = ''.join(info) |
|
|
|
message_values['message_type'] = ''.join(info) |
|
|
|
markup = MESSAGE_FORMAT % (message_values) |
|
|
|
markup = MESSAGE_FORMAT % (message_values) |
|
|
|
|
|
|
|
|
|
|
@ -1570,3 +1577,11 @@ class Interface(object): |
|
|
|
metavar='CHAR', |
|
|
|
metavar='CHAR', |
|
|
|
default='☆', |
|
|
|
default='☆', |
|
|
|
is_cmd_option=False) |
|
|
|
is_cmd_option=False) |
|
|
|
|
|
|
|
options.add_option( |
|
|
|
|
|
|
|
group=self.NAMESPACE, |
|
|
|
|
|
|
|
option='protected_char', |
|
|
|
|
|
|
|
help='String to be used to indicate that a message is ' \ |
|
|
|
|
|
|
|
'protected/private.', |
|
|
|
|
|
|
|
metavar='CHAR', |
|
|
|
|
|
|
|
default=_('<small>(protected)</small>'), |
|
|
|
|
|
|
|
is_cmd_option=False) |
|
|
|