Commit f4ad05a4 authored by Dicson's avatar Dicson

ChatstatePlugin. gtk3 support

parent 0b495e09
from chatstate import ChatstatePlugin
from .chatstate import ChatstatePlugin
# -*- coding: utf-8 -*-
##
import gobject
from gi.repository import GObject
from plugins import GajimPlugin
from plugins.helpers import log_calls
......@@ -21,11 +21,11 @@ def paragraph_direction_mark(text):
for char in text:
bidi = unicodedata.bidirectional(char)
if bidi == 'L':
return u'\u200E'
return '\u200E'
elif bidi == 'AL' or bidi == 'R':
return u'\u200F'
return '\u200F'
return u'\u200E'
return '\u200E'
class ChatstatePlugin(GajimPlugin):
......@@ -57,7 +57,7 @@ class ChatstatePlugin(GajimPlugin):
child_iters = gajim.interface.roster._get_contact_iter(obj.jid,
obj.conn.name, contact, self.model)
name = gobject.markup_escape_text(contact.get_shown_name())
name = GObject.markup_escape_text(contact.get_shown_name())
contact_instances = gajim.contacts.get_contacts(obj.conn.name,
contact.jid)
......@@ -68,7 +68,7 @@ class ChatstatePlugin(GajimPlugin):
nb_connected_contact += 1
if nb_connected_contact > 1:
name += paragraph_direction_mark(unicode(name))
name += u' (%d)' % nb_connected_contact
name += ' (%d)' % nb_connected_contact
for child_iter in child_iters:
if chatstate != 'gone':
......@@ -82,7 +82,7 @@ class ChatstatePlugin(GajimPlugin):
max_lines=1)
name += '\n<span size="small" style="italic" ' \
'foreground="%s">%s</span>' % (self.status_color,
gobject.markup_escape_text(status))
GObject.markup_escape_text(status))
self.model[child_iter][1] = name
@log_calls('ChatstatePlugin')
......
......@@ -7,4 +7,4 @@ description: Chat State Notifications in roster.
The plugin does not work if you use custom font color for contacts in roster.
authors = Denis Fomin <fominde@gmail.com>
homepage = http://trac-plugins.gajim.org/wiki/ChatstatePlugin
max_gajim_version: 0.15.9
min_gajim_version: 0.15.10
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment