[CalendarServer-changes] [3661] CalendarServer/trunk/twistedcaldav/notify.py

source_changes at macosforge.org source_changes at macosforge.org
Thu Feb 12 11:28:03 PST 2009


Revision: 3661
          http://trac.macosforge.org/projects/calendarserver/changeset/3661
Author:   sagen at apple.com
Date:     2009-02-12 11:28:02 -0800 (Thu, 12 Feb 2009)
Log Message:
-----------
Generate a unique JID resource so that multiple icalservers can share the same xmpp server

Modified Paths:
--------------
    CalendarServer/trunk/twistedcaldav/notify.py

Modified: CalendarServer/trunk/twistedcaldav/notify.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/notify.py	2009-02-12 10:06:42 UTC (rev 3660)
+++ CalendarServer/trunk/twistedcaldav/notify.py	2009-02-12 19:28:02 UTC (rev 3661)
@@ -54,6 +54,7 @@
 from twistedcaldav import memcachepool
 from zope.interface import Interface, implements
 from fnmatch import fnmatch
+import uuid
 
 __all__ = [
     "ClientNotifier",
@@ -1079,7 +1080,18 @@
 
         self.notifier = notifier
         self.settings = settings
+
         self.jid = settings['JID']
+
+        # Ignore JID resource from plist
+        slash = self.jid.find("/")
+        if slash > -1:
+            self.jid = self.jid[0:slash]
+
+        # Generate a unique JID resource value
+        resource = "icalserver.%s" % uuid.uuid4().hex
+        self.jid = "%s/%s" % (self.jid, resource)
+
         self.keepAliveSeconds = settings.get('KeepAliveSeconds', 120)
         self.xmlStream = None
         self.presenceCall = None
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20090212/4fc713a9/attachment.html>


More information about the calendarserver-changes mailing list