From dd55845af76f57db2cb1bab87ad5ed86b65c9154 Mon Sep 17 00:00:00 2001 From: Madhur Garg Date: Tue, 26 Mar 2019 23:13:45 +0530 Subject: Corrects the functionality of /add and /accept commands in all the tabs. Fixes #3395 Corrects the functionality of /add command in all tabs. Fixes #3395 Removed trailing whitespaces Corrected general way of writing code. Corrects the functionality of /add and /accept commands in all tabs. Fixes #3395 --- poezio/tabs/rostertab.py | 42 ------------------------------------------ 1 file changed, 42 deletions(-) (limited to 'poezio/tabs') diff --git a/poezio/tabs/rostertab.py b/poezio/tabs/rostertab.py index 6d806120..a5ce268b 100644 --- a/poezio/tabs/rostertab.py +++ b/poezio/tabs/rostertab.py @@ -91,14 +91,6 @@ class RosterInfoTab(Tab): 'you to be in their roster.', shortdesc='Deny a user your presence.', completion=self.completion_deny) - self.register_command( - 'accept', - self.command_accept, - usage='[jid]', - desc='Allow the provided JID (or the selected contact ' - 'in your roster), to see your presence.', - shortdesc='Allow a user your presence.', - completion=self.completion_deny) self.register_command( 'name', self.command_name, @@ -1030,40 +1022,6 @@ class RosterInfoTab(Tab): if contact.pending_in) return Completion(the_input.new_completion, jids, 1, '', quotify=False) - @deny_anonymous - @command_args_parser.quoted(0, 1) - def command_accept(self, args): - """ - Accept a JID from in roster. Authorize it AND subscribe to it - """ - if not args: - item = self.roster_win.selected_row - if isinstance(item, Contact): - jid = item.bare_jid - else: - self.core.information('No subscription to accept', 'Warning') - return - else: - jid = safeJID(args[0]).bare - nodepart = safeJID(jid).user - jid = safeJID(jid) - # crappy transports putting resources inside the node part - if '\\2f' in nodepart: - jid.user = nodepart.split('\\2f')[0] - contact = roster[jid] - if contact is None: - return - contact.pending_in = False - roster.modified() - self.core.xmpp.send_presence(pto=jid, ptype='subscribed') - self.core.xmpp.client_roster.send_last_presence() - if contact.subscription in ('from', - 'none') and not contact.pending_out: - self.core.xmpp.send_presence( - pto=jid, ptype='subscribe', pnick=self.core.own_nick) - - self.core.information('%s is now authorized' % jid, 'Roster') - def refresh(self): if self.need_resize: self.resize() -- cgit v1.2.3