File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 1
- ## transports .py
1
+ ## dispatcher .py
2
2
##
3
3
## Copyright (C) 2003-2005 Alexey "Snake" Nezhdanov
4
4
##
21
21
Dispatcher.SendAndWaitForResponce method will wait for reply stanza before giving up.
22
22
"""
23
23
24
- import simplexml ,time ,sys
24
+ import simplexml ,time ,sys , random
25
25
from protocol import *
26
26
from client import PlugIn
27
27
28
28
DefaultTimeout = 25
29
29
ID = 0
30
+ SALT = random .randint (1 ,100000 )
30
31
31
32
class Dispatcher (PlugIn ):
32
33
""" Ancestor of PlugIn class. Handles XMPP stream, i.e. aware of stream headers.
@@ -350,7 +351,7 @@ def send(self,stanza):
350
351
elif not stanza .getID ():
351
352
global ID
352
353
ID += 1
353
- _ID = `ID`
354
+ _ID = "%s_#%s#-%s" % ( self . _owner . User , SALT , `ID` )
354
355
stanza .setID (_ID )
355
356
else : _ID = stanza .getID ()
356
357
if self ._owner ._registered_name and not stanza .getAttr ('from' ): stanza .setAttr ('from' ,self ._owner ._registered_name )
You can’t perform that action at this time.
0 commit comments