we can now revoke a contact's authorization

This commit is contained in:
Yann Leboulanger 2005-11-25 21:32:56 +00:00
parent aa25e739c6
commit e59058845c
2 changed files with 55 additions and 18 deletions

View File

@ -16182,7 +16182,7 @@ Banner</property>
<property name="use_underline">True</property>
<child internal-child="image">
<widget class="GtkImage" id="image996">
<widget class="GtkImage" id="image1266">
<property name="visible">True</property>
<property name="stock">gtk-jump-to</property>
<property name="icon_size">1</property>
@ -16202,7 +16202,7 @@ Banner</property>
<property name="use_underline">True</property>
<child internal-child="image">
<widget class="GtkImage" id="image997">
<widget class="GtkImage" id="image1267">
<property name="visible">True</property>
<property name="stock">gtk-new</property>
<property name="icon_size">1</property>
@ -16221,7 +16221,7 @@ Banner</property>
<property name="use_underline">True</property>
<child internal-child="image">
<widget class="GtkImage" id="image998">
<widget class="GtkImage" id="image1268">
<property name="visible">True</property>
<property name="stock">gtk-refresh</property>
<property name="icon_size">1</property>
@ -16255,7 +16255,7 @@ Banner</property>
<signal name="activate" handler="on_send_file_menuitem_activate" last_modification_time="Thu, 01 Sep 2005 23:13:17 GMT"/>
<child internal-child="image">
<widget class="GtkImage" id="image999">
<widget class="GtkImage" id="image1269">
<property name="visible">True</property>
<property name="stock">gtk-file</property>
<property name="icon_size">1</property>
@ -16275,7 +16275,7 @@ Banner</property>
<signal name="activate" handler="on_assign_openpgp_key_menuitem_activate" last_modification_time="Thu, 30 Jun 2005 22:57:59 GMT"/>
<child internal-child="image">
<widget class="GtkImage" id="image1000">
<widget class="GtkImage" id="image1270">
<property name="visible">True</property>
<property name="stock">gtk-dialog-authentication</property>
<property name="icon_size">1</property>
@ -16300,7 +16300,7 @@ Banner</property>
<property name="use_underline">True</property>
<child internal-child="image">
<widget class="GtkImage" id="image1001">
<widget class="GtkImage" id="image1271">
<property name="visible">True</property>
<property name="stock">gtk-dialog-question</property>
<property name="icon_size">1</property>
@ -16317,11 +16317,11 @@ Banner</property>
<child>
<widget class="GtkImageMenuItem" id="resend_authorization_to_menuitem">
<property name="visible">True</property>
<property name="label" translatable="yes">Send Authorization to</property>
<property name="label" translatable="yes">Allow him/her to see my status</property>
<property name="use_underline">True</property>
<child internal-child="image">
<widget class="GtkImage" id="image1002">
<widget class="GtkImage" id="image1272">
<property name="visible">True</property>
<property name="stock">gtk-go-up</property>
<property name="icon_size">1</property>
@ -16337,11 +16337,11 @@ Banner</property>
<child>
<widget class="GtkImageMenuItem" id="rerequest_authorization_from_menuitem">
<property name="visible">True</property>
<property name="label" translatable="yes">Re_quest Authorization from</property>
<property name="label" translatable="yes">Ask to see his/her status</property>
<property name="use_underline">True</property>
<child internal-child="image">
<widget class="GtkImage" id="image1003">
<widget class="GtkImage" id="image1273">
<property name="visible">True</property>
<property name="stock">gtk-go-down</property>
<property name="icon_size">1</property>
@ -16353,6 +16353,27 @@ Banner</property>
</child>
</widget>
</child>
<child>
<widget class="GtkImageMenuItem" id="forbid_him/her_to_see_my_status1">
<property name="visible">True</property>
<property name="label" translatable="yes">Forbid him/her to see my status</property>
<property name="use_underline">True</property>
<signal name="activate" handler="revoke_authorization_to_menuitem" last_modification_time="Fri, 25 Nov 2005 21:26:31 GMT"/>
<child internal-child="image">
<widget class="GtkImage" id="image1274">
<property name="visible">True</property>
<property name="stock">gtk-stop</property>
<property name="icon_size">1</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
</child>
</widget>
</child>
</widget>
</child>
</widget>
@ -16364,7 +16385,7 @@ Banner</property>
<property name="use_underline">True</property>
<child internal-child="image">
<widget class="GtkImage" id="image1004">
<widget class="GtkImage" id="image1275">
<property name="visible">True</property>
<property name="stock">gtk-add</property>
<property name="icon_size">1</property>
@ -16383,7 +16404,7 @@ Banner</property>
<property name="use_underline">True</property>
<child internal-child="image">
<widget class="GtkImage" id="image1005">
<widget class="GtkImage" id="image1276">
<property name="visible">True</property>
<property name="stock">gtk-remove</property>
<property name="icon_size">1</property>
@ -16415,7 +16436,7 @@ Banner</property>
<property name="use_underline">True</property>
<child internal-child="image">
<widget class="GtkImage" id="image1006">
<widget class="GtkImage" id="image1277">
<property name="visible">True</property>
<property name="stock">gtk-justify-fill</property>
<property name="icon_size">1</property>

View File

@ -939,7 +939,7 @@ class RosterWindow:
assign_openpgp_key_menuitem = childs[6]
#skip a seperator
subscription_to_menuitem, subscription_from_menuitem =\
send_auth_menuitem, ask_auth_menuitem, revoke_auth_menuitem =\
childs[8].get_submenu().get_children()
add_to_roster_menuitem = childs[9]
remove_from_roster_menuitem = childs[10]
@ -980,10 +980,20 @@ class RosterWindow:
assign_openpgp_key_menuitem.connect('activate',
self.on_assign_pgp_key, contact, account)
subscription_to_menuitem.connect('activate', self.authorize, jid,
account)
subscription_from_menuitem.connect('activate', self.req_sub,
jid, _('I would like to add you to my roster'), account)
if contact.sub in ('from', 'both'):
send_auth_menuitem.set_sensitive(False)
else:
send_auth_menuitem.connect('activate', self.authorize, jid, account)
if contact.sub in ('to', 'both'):
ask_auth_menuitem.set_sensitive(False)
else:
ask_auth_menuitem.connect('activate', self.req_sub, jid,
_('I would like to add you to my roster'), account)
if contact.sub in ('to', 'none'):
revoke_auth_menuitem.set_sensitive(False)
else:
revoke_auth_menuitem.connect('activate', self.revoke_auth, jid,
account)
else: # contact is in group 'not in the roster'
add_to_roster_menuitem.set_no_show_all(False)
@ -1237,6 +1247,12 @@ _('If "%s" accepts this request you will know his or her status.') %jid)
self.remove_contact(user1, account)
self.add_contact_to_roster(jid, account)
def revoke_auth(self, widget, jid, account):
'''Revoke a contact's authorization'''
gajim.connections[account].refuse_authorization(jid)
dialogs.InformationDialog(_('Authorization has been removed'),
_('Now "%s" will always see you as offline.') %jid)
def on_roster_treeview_scroll_event(self, widget, event):
self.tooltip.hide_tooltip()