Do not use xmpppy DataForm class

This commit is contained in:
Yann Leboulanger 2007-06-06 21:40:56 +00:00
parent 42746fc24f
commit 044feb0e1f
1 changed files with 4 additions and 7 deletions

View File

@ -128,16 +128,13 @@ def _ReceivedRegInfo(con, resp, agent):
return return
df=tag.getTag('x',namespace=NS_DATA) df=tag.getTag('x',namespace=NS_DATA)
if df: if df:
con.Event(NS_REGISTER,REGISTER_DATA_RECEIVED,(agent,DataForm(node=df),True,'')) con.Event(NS_REGISTER,REGISTER_DATA_RECEIVED,(agent,df,True,''))
return return
df=DataForm(typ='form') df={}
for i in resp.getQueryPayload(): for i in resp.getQueryPayload():
if not isinstance(i, Node): if not isinstance(i, Node):
pass continue
elif i.getName()=='instructions': df[i.getName()] = i.getData()
df.addInstructions(i.getData())
else:
df.setField(i.getName()).setValue(i.getData())
con.Event(NS_REGISTER, REGISTER_DATA_RECEIVED, (agent,df,False,'')) con.Event(NS_REGISTER, REGISTER_DATA_RECEIVED, (agent,df,False,''))
def register(disp, host, info, cb): def register(disp, host, info, cb):