From 6dfea828be54d9048779d06b4b31be98b58a2343 Mon Sep 17 00:00:00 2001 From: fritzy Date: Tue, 31 Aug 2010 14:44:24 +0000 Subject: [PATCH] xep-0004 merge should deal with dictionaries --- sleekxmpp/plugins/xep_0004.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sleekxmpp/plugins/xep_0004.py b/sleekxmpp/plugins/xep_0004.py index 9e67e656..a4cb8e9f 100644 --- a/sleekxmpp/plugins/xep_0004.py +++ b/sleekxmpp/plugins/xep_0004.py @@ -13,6 +13,7 @@ from .. xmlstream.handler.callback import Callback from .. xmlstream.matcher.xpath import MatchXPath from .. xmlstream.stanzabase import registerStanzaPlugin, ElementBase, ET, JID from .. stanza.message import Message +import types class Form(ElementBase): @@ -199,6 +200,9 @@ class Form(ElementBase): def merge(self, other): new = copy.copy(self) + if type(other) == types.DictType: + new.setValues(other) + return new nfields = new.getFields(use_dict=True) ofields = other.getFields(use_dict=True) nfields.update(ofields)