comparison src/server/session_iface.py @ 947:92f0eeb6dc72

pages: cache identities identities in session + get identities for comments in blog
author Goffi <goffi@goffi.org>
date Tue, 23 May 2017 00:06:00 +0200
parents 7b267496da1d
children dabecab10faa
comparison
equal deleted inserted replaced
946:d076b722ca52 947:92f0eeb6dc72
15 # GNU Affero General Public License for more details. 15 # GNU Affero General Public License for more details.
16 16
17 # You should have received a copy of the GNU Affero General Public License 17 # You should have received a copy of the GNU Affero General Public License
18 # along with this program. If not, see <http://www.gnu.org/licenses/>. 18 # along with this program. If not, see <http://www.gnu.org/licenses/>.
19 from zope.interface import Interface, Attribute, implements 19 from zope.interface import Interface, Attribute, implements
20 from sat.tools.common import data_objects
20 import shortuuid 21 import shortuuid
21 22
22 class ISATSession(Interface): 23 class ISATSession(Interface):
23 profile = Attribute("Sat profile") 24 profile = Attribute("Sat profile")
24 jid = Attribute("JID associated with the profile") 25 jid = Attribute("JID associated with the profile")
25 uuid = Attribute("uuid associated with the profile session") 26 uuid = Attribute("uuid associated with the profile session")
27 identities = Attribute("Identities of XMPP entities")
26 28
27 29
28 class SATSession(object): 30 class SATSession(object):
29 implements(ISATSession) 31 implements(ISATSession)
30 32
31 def __init__(self, session): 33 def __init__(self, session):
32 self.profile = None 34 self.profile = None
33 self.jid = None 35 self.jid = None
34 self.uuid = unicode(shortuuid.uuid()) 36 self.uuid = unicode(shortuuid.uuid())
37 self.identities = data_objects.Identities()
35 38
36 39
37 class ISATGuestSession(Interface): 40 class ISATGuestSession(Interface):
38 id = Attribute("UUID of the guest") 41 id = Attribute("UUID of the guest")
39 data = Attribute("data associated with the guest") 42 data = Attribute("data associated with the guest")