in vcard window, print role and affiliation when it's a gc vcard. Fixes #2457
This commit is contained in:
parent
b06c56a3fc
commit
1ee6cbc8cf
|
@ -448,7 +448,7 @@
|
||||||
</child>
|
</child>
|
||||||
|
|
||||||
<child>
|
<child>
|
||||||
<widget class="GtkLabel" id="label45">
|
<widget class="GtkLabel" id="subscription_title_label">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="label" translatable="yes" comments="Family Name">Subscription:</property>
|
<property name="label" translatable="yes" comments="Family Name">Subscription:</property>
|
||||||
<property name="use_underline">False</property>
|
<property name="use_underline">False</property>
|
||||||
|
@ -476,7 +476,7 @@
|
||||||
</child>
|
</child>
|
||||||
|
|
||||||
<child>
|
<child>
|
||||||
<widget class="GtkLabel" id="label46">
|
<widget class="GtkLabel" id="ask_title_label">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="label" translatable="yes" comments="Given Name">Ask:</property>
|
<property name="label" translatable="yes" comments="Given Name">Ask:</property>
|
||||||
<property name="use_underline">False</property>
|
<property name="use_underline">False</property>
|
||||||
|
|
|
@ -1834,7 +1834,7 @@ class GroupchatControl(ChatControlBase):
|
||||||
present()
|
present()
|
||||||
else:
|
else:
|
||||||
gajim.interface.instances[self.account]['infos'][c2.jid] = \
|
gajim.interface.instances[self.account]['infos'][c2.jid] = \
|
||||||
vcard.VcardWindow(c2, self.account, is_fake = True)
|
vcard.VcardWindow(c2, self.account, c)
|
||||||
|
|
||||||
def on_history(self, widget, nick):
|
def on_history(self, widget, nick):
|
||||||
jid = gajim.construct_fjid(self.room_jid, nick)
|
jid = gajim.construct_fjid(self.room_jid, nick)
|
||||||
|
|
25
src/vcard.py
25
src/vcard.py
|
@ -59,7 +59,7 @@ def get_avatar_pixbuf_encoded_mime(photo):
|
||||||
class VcardWindow:
|
class VcardWindow:
|
||||||
'''Class for contact's information window'''
|
'''Class for contact's information window'''
|
||||||
|
|
||||||
def __init__(self, contact, account, is_fake = False):
|
def __init__(self, contact, account, gc_contact = None):
|
||||||
# the contact variable is the jid if vcard is true
|
# the contact variable is the jid if vcard is true
|
||||||
self.xml = gtkgui_helpers.get_glade('vcard_information_window.glade')
|
self.xml = gtkgui_helpers.get_glade('vcard_information_window.glade')
|
||||||
self.window = self.xml.get_widget('vcard_information_window')
|
self.window = self.xml.get_widget('vcard_information_window')
|
||||||
|
@ -67,7 +67,7 @@ class VcardWindow:
|
||||||
|
|
||||||
self.contact = contact
|
self.contact = contact
|
||||||
self.account = account
|
self.account = account
|
||||||
self.is_fake = is_fake
|
self.gc_contact = gc_contact
|
||||||
|
|
||||||
self.avatar_mime_type = None
|
self.avatar_mime_type = None
|
||||||
self.avatar_encoded = None
|
self.avatar_encoded = None
|
||||||
|
@ -245,8 +245,20 @@ class VcardWindow:
|
||||||
self.contact.get_shown_name() +
|
self.contact.get_shown_name() +
|
||||||
'</span></b>')
|
'</span></b>')
|
||||||
self.xml.get_widget('jid_label').set_text(self.contact.jid)
|
self.xml.get_widget('jid_label').set_text(self.contact.jid)
|
||||||
|
|
||||||
|
subscription_label = self.xml.get_widget('subscription_label')
|
||||||
|
ask_label = self.xml.get_widget('ask_label')
|
||||||
|
if self.gc_contact:
|
||||||
|
self.xml.get_widget('subscription_title_label').set_text(_("Role:"))
|
||||||
|
uf_role = helpers.get_uf_role(self.gc_contact.role)
|
||||||
|
subscription_label.set_text(uf_role)
|
||||||
|
|
||||||
|
self.xml.get_widget('ask_title_label').set_text(_("Affiliation:"))
|
||||||
|
uf_affiliation = helpers.get_uf_affiliation(self.gc_contact.affiliation)
|
||||||
|
ask_label.set_text(uf_affiliation)
|
||||||
|
else:
|
||||||
uf_sub = helpers.get_uf_sub(self.contact.sub)
|
uf_sub = helpers.get_uf_sub(self.contact.sub)
|
||||||
self.xml.get_widget('subscription_label').set_text(uf_sub)
|
subscription_label.set_text(uf_sub)
|
||||||
eb = self.xml.get_widget('subscription_label_eventbox')
|
eb = self.xml.get_widget('subscription_label_eventbox')
|
||||||
if self.contact.sub == 'from':
|
if self.contact.sub == 'from':
|
||||||
tt_text = _("This contact is interested in your presence information, but you are not interested in his/her presence")
|
tt_text = _("This contact is interested in your presence information, but you are not interested in his/her presence")
|
||||||
|
@ -258,13 +270,13 @@ class VcardWindow:
|
||||||
tt_text = _("You are not interested in the contact's presence, and neither he/she is interested in yours")
|
tt_text = _("You are not interested in the contact's presence, and neither he/she is interested in yours")
|
||||||
tooltips.set_tip(eb, tt_text)
|
tooltips.set_tip(eb, tt_text)
|
||||||
|
|
||||||
label = self.xml.get_widget('ask_label')
|
|
||||||
uf_ask = helpers.get_uf_ask(self.contact.ask)
|
uf_ask = helpers.get_uf_ask(self.contact.ask)
|
||||||
label.set_text(uf_ask)
|
ask_label.set_text(uf_ask)
|
||||||
eb = self.xml.get_widget('ask_label_eventbox')
|
eb = self.xml.get_widget('ask_label_eventbox')
|
||||||
if self.contact.ask == 'subscribe':
|
if self.contact.ask == 'subscribe':
|
||||||
tooltips.set_tip(eb,
|
tooltips.set_tip(eb,
|
||||||
_("You are waiting contact's answer about your subscription request"))
|
_("You are waiting contact's answer about your subscription request"))
|
||||||
|
|
||||||
log = True
|
log = True
|
||||||
if self.contact.jid in gajim.config.get_per('accounts', self.account,
|
if self.contact.jid in gajim.config.get_per('accounts', self.account,
|
||||||
'no_log_for').split(' '):
|
'no_log_for').split(' '):
|
||||||
|
@ -317,7 +329,8 @@ class VcardWindow:
|
||||||
|
|
||||||
self.fill_status_label()
|
self.fill_status_label()
|
||||||
|
|
||||||
gajim.connections[self.account].request_vcard(self.contact.jid, self.is_fake)
|
gajim.connections[self.account].request_vcard(self.contact.jid,
|
||||||
|
self.gc_contact is not None)
|
||||||
|
|
||||||
def on_close_button_clicked(self, widget):
|
def on_close_button_clicked(self, widget):
|
||||||
self.window.destroy()
|
self.window.destroy()
|
||||||
|
|
Loading…
Reference in New Issue