core, plugins: fixed bad namespace in stanza creation
This commit is contained in:
parent
20815b3ec5
commit
a6d8990e49
1 changed files with 41 additions and 41 deletions
|
|
@ -121,7 +121,7 @@ class Quiz():
|
|||
|
||||
def createGameElt(self, to_jid, type="normal"):
|
||||
type = "normal" if to_jid.resource else "groupchat"
|
||||
elt = domish.Element(('jabber:client','message'))
|
||||
elt = domish.Element((None,'message'))
|
||||
elt["to"] = to_jid.full()
|
||||
elt["type"] = type
|
||||
elt.addElement((NS_QG, QG_TAG))
|
||||
|
|
@ -129,9 +129,9 @@ class Quiz():
|
|||
|
||||
def __game_data_to_xml(self, game_data):
|
||||
"""Convert a game data dict to domish element"""
|
||||
game_data_elt = domish.Element(('','game_data'))
|
||||
game_data_elt = domish.Element((None,'game_data'))
|
||||
for data in game_data:
|
||||
data_elt = domish.Element(('',data))
|
||||
data_elt = domish.Element((None,data))
|
||||
data_elt.addContent(game_data[data])
|
||||
game_data_elt.addChild(data_elt)
|
||||
return game_data_elt
|
||||
|
|
@ -162,12 +162,12 @@ class Quiz():
|
|||
for player in game_data['players']:
|
||||
score[player] = players_data[player]['score']
|
||||
|
||||
answer_result_elt = domish.Element(('','answer_result'))
|
||||
answer_result_elt = domish.Element((None,'answer_result'))
|
||||
answer_result_elt['player'] = player_answering
|
||||
answer_result_elt['good_answer'] = str(good_answer)
|
||||
|
||||
for player in score:
|
||||
score_elt = domish.Element(('',"score"))
|
||||
score_elt = domish.Element((None,"score"))
|
||||
score_elt['player'] = player
|
||||
score_elt['score'] = str(score[player])
|
||||
answer_result_elt.addChild(score_elt)
|
||||
|
|
@ -176,10 +176,10 @@ class Quiz():
|
|||
|
||||
def __create_started_elt(self, players):
|
||||
"""Create a game_started domish element"""
|
||||
started_elt = domish.Element(('','started'))
|
||||
started_elt = domish.Element((None,'started'))
|
||||
idx = 0
|
||||
for player in players:
|
||||
player_elt = domish.Element(('','player'))
|
||||
player_elt = domish.Element((None,'player'))
|
||||
player_elt.addContent(player)
|
||||
player_elt['index'] = str(idx)
|
||||
idx+=1
|
||||
|
|
@ -188,7 +188,7 @@ class Quiz():
|
|||
|
||||
def __ask_question(self, question_id, question, timer):
|
||||
"""Create a element for asking a question"""
|
||||
question_elt = domish.Element(('','question'))
|
||||
question_elt = domish.Element((None,'question'))
|
||||
question_elt['id'] = question_id
|
||||
question_elt['timer'] = str(timer)
|
||||
question_elt.addContent(question)
|
||||
|
|
|
|||
Loading…
Reference in a new issue