Commit e9d2f233 authored by Yann Leboulanger's avatar Yann Leboulanger

[tmolitor] use uuid instead of plain counting integers for stanza ids

parent c16066d1
......@@ -25,6 +25,7 @@ from . import simplexml
import sys
import locale
import re
import uuid
from xml.parsers.expat import ExpatError
from .plugin import PlugIn
from .protocol import (NS_STREAMS, NS_XMPP_STREAMS, NS_HTTP_BIND, Iq, Presence,
......@@ -38,7 +39,6 @@ log = logging.getLogger('nbxmpp.dispatcher_nb')
#: default timeout to wait for response for our id
DEFAULT_TIMEOUT_SECONDS = 25
outgoingID = 0
XML_DECLARATION = '<?xml version=\'1.0\'?>'
......@@ -120,9 +120,7 @@ class XMPPDispatcher(PlugIn):
self.invalid_chars_re = re.compile(r)
def getAnID(self):
global outgoingID
outgoingID += 1
return repr(outgoingID)
return str(uuid.uuid4())
def dumpHandlers(self):
"""
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment