Permalink
Browse files

implement allowRegister

  • Loading branch information...
normanr committed Oct 8, 2006
1 parent b4a06e3 commit dafda68db9bb68b5a20ca90ad63887a3d509f886
Showing with 8 additions and 1 deletion.
  1. +8 −1 yahoo.py
View
@@ -490,10 +490,13 @@ def xmpp_base_disco(self, con, event, type):
if to == config.jid:
if node == None:
if type == 'info':
+ features = [NS_VERSION,NS_COMMANDS,NS_AVATAR]
+ if config.allowRegister:
+ features = [NS_REGISTER] + features
return {
'ids':[
{'category':'gateway','type':'yahoo','name':VERSTR}],
- 'features':[NS_REGISTER,NS_VERSION,NS_COMMANDS,NS_AVATAR]}
+ 'features':features}
if type == 'items':
list = [
{'node':NODE_ROSTER,'name':config.discoName + ' Roster','jid':config.jid}]
@@ -670,6 +673,8 @@ def xmpp_iq_discoinfo_results(self, con, event):
raise NodeProcessed
def xmpp_iq_register_get(self, con, event):
+ if not config.allowRegister:
+ return
if event.getTo() == config.jid:
username = []
password = []
@@ -692,6 +697,8 @@ def xmpp_iq_register_get(self, con, event):
raise NodeProcessed
def xmpp_iq_register_set(self, con, event):
+ if not config.allowRegister:
+ return
if event.getTo() == config.jid:
remove = False
username = False

0 comments on commit dafda68

Please sign in to comment.