annotate libervia/pages/chat/page_meta.py @ 1241:921e9f2a97af

pages (chat): renamed `extra` argument to `extra_s` as it is now serialised
author Goffi <goffi@goffi.org>
date Fri, 14 Feb 2020 15:21:24 +0100
parents 4ccc5bb65be2
children 8aff742d0dd0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1216
b2d067339de3 python 3 port:
Goffi <goffi@goffi.org>
parents: 1203
diff changeset
1 #!/usr/bin/env python3
996
d821c112e656 pages (chat): implementation of chat page using new dynamic pages, first draft
Goffi <goffi@goffi.org>
parents:
diff changeset
2
d821c112e656 pages (chat): implementation of chat page using new dynamic pages, first draft
Goffi <goffi@goffi.org>
parents:
diff changeset
3 from sat.core.i18n import _
d821c112e656 pages (chat): implementation of chat page using new dynamic pages, first draft
Goffi <goffi@goffi.org>
parents:
diff changeset
4 from twisted.internet import defer
d821c112e656 pages (chat): implementation of chat page using new dynamic pages, first draft
Goffi <goffi@goffi.org>
parents:
diff changeset
5 from sat.core.log import getLogger
d821c112e656 pages (chat): implementation of chat page using new dynamic pages, first draft
Goffi <goffi@goffi.org>
parents:
diff changeset
6 from sat.tools.common import data_objects
d821c112e656 pages (chat): implementation of chat page using new dynamic pages, first draft
Goffi <goffi@goffi.org>
parents:
diff changeset
7 from twisted.words.protocols.jabber import jid
d821c112e656 pages (chat): implementation of chat page using new dynamic pages, first draft
Goffi <goffi@goffi.org>
parents:
diff changeset
8 from libervia.server.constants import Const as C
d821c112e656 pages (chat): implementation of chat page using new dynamic pages, first draft
Goffi <goffi@goffi.org>
parents:
diff changeset
9 from libervia.server import session_iface
d821c112e656 pages (chat): implementation of chat page using new dynamic pages, first draft
Goffi <goffi@goffi.org>
parents:
diff changeset
10
1241
921e9f2a97af pages (chat): renamed `extra` argument to `extra_s` as it is now serialised
Goffi <goffi@goffi.org>
parents: 1232
diff changeset
11
921e9f2a97af pages (chat): renamed `extra` argument to `extra_s` as it is now serialised
Goffi <goffi@goffi.org>
parents: 1232
diff changeset
12 log = getLogger(__name__)
921e9f2a97af pages (chat): renamed `extra` argument to `extra_s` as it is now serialised
Goffi <goffi@goffi.org>
parents: 1232
diff changeset
13
1216
b2d067339de3 python 3 port:
Goffi <goffi@goffi.org>
parents: 1203
diff changeset
14 name = "chat"
996
d821c112e656 pages (chat): implementation of chat page using new dynamic pages, first draft
Goffi <goffi@goffi.org>
parents:
diff changeset
15 access = C.PAGES_ACCESS_PROFILE
1216
b2d067339de3 python 3 port:
Goffi <goffi@goffi.org>
parents: 1203
diff changeset
16 template = "chat/chat.html"
996
d821c112e656 pages (chat): implementation of chat page using new dynamic pages, first draft
Goffi <goffi@goffi.org>
parents:
diff changeset
17 dynamic = True
d821c112e656 pages (chat): implementation of chat page using new dynamic pages, first draft
Goffi <goffi@goffi.org>
parents:
diff changeset
18
d821c112e656 pages (chat): implementation of chat page using new dynamic pages, first draft
Goffi <goffi@goffi.org>
parents:
diff changeset
19
d821c112e656 pages (chat): implementation of chat page using new dynamic pages, first draft
Goffi <goffi@goffi.org>
parents:
diff changeset
20 def parse_url(self, request):
d821c112e656 pages (chat): implementation of chat page using new dynamic pages, first draft
Goffi <goffi@goffi.org>
parents:
diff changeset
21 rdata = self.getRData(request)
d821c112e656 pages (chat): implementation of chat page using new dynamic pages, first draft
Goffi <goffi@goffi.org>
parents:
diff changeset
22
d821c112e656 pages (chat): implementation of chat page using new dynamic pages, first draft
Goffi <goffi@goffi.org>
parents:
diff changeset
23 try:
d821c112e656 pages (chat): implementation of chat page using new dynamic pages, first draft
Goffi <goffi@goffi.org>
parents:
diff changeset
24 target_jid_s = self.nextPath(request)
d821c112e656 pages (chat): implementation of chat page using new dynamic pages, first draft
Goffi <goffi@goffi.org>
parents:
diff changeset
25 except IndexError:
1000
4cc4d49e1d0f pages (chat): moved rendering preparation in prepare_render, and redirect to page_select if no jid is specified.
Goffi <goffi@goffi.org>
parents: 996
diff changeset
26 # not chat jid, we redirect to jid selection page
1216
b2d067339de3 python 3 port:
Goffi <goffi@goffi.org>
parents: 1203
diff changeset
27 self.pageRedirect("chat_select", request)
996
d821c112e656 pages (chat): implementation of chat page using new dynamic pages, first draft
Goffi <goffi@goffi.org>
parents:
diff changeset
28
d821c112e656 pages (chat): implementation of chat page using new dynamic pages, first draft
Goffi <goffi@goffi.org>
parents:
diff changeset
29 try:
d821c112e656 pages (chat): implementation of chat page using new dynamic pages, first draft
Goffi <goffi@goffi.org>
parents:
diff changeset
30 target_jid = jid.JID(target_jid_s)
d821c112e656 pages (chat): implementation of chat page using new dynamic pages, first draft
Goffi <goffi@goffi.org>
parents:
diff changeset
31 if not target_jid.user:
1216
b2d067339de3 python 3 port:
Goffi <goffi@goffi.org>
parents: 1203
diff changeset
32 raise ValueError(_("invalid jid for chat (no local part)"))
996
d821c112e656 pages (chat): implementation of chat page using new dynamic pages, first draft
Goffi <goffi@goffi.org>
parents:
diff changeset
33 except Exception as e:
1113
cdd389ef97bc server: code style reformatting using black
Goffi <goffi@goffi.org>
parents: 1091
diff changeset
34 log.warning(
1216
b2d067339de3 python 3 port:
Goffi <goffi@goffi.org>
parents: 1203
diff changeset
35 _("bad chat jid entered: {jid} ({msg})").format(jid=target_jid, msg=e)
1113
cdd389ef97bc server: code style reformatting using black
Goffi <goffi@goffi.org>
parents: 1091
diff changeset
36 )
996
d821c112e656 pages (chat): implementation of chat page using new dynamic pages, first draft
Goffi <goffi@goffi.org>
parents:
diff changeset
37 self.pageError(request, C.HTTP_BAD_REQUEST)
d821c112e656 pages (chat): implementation of chat page using new dynamic pages, first draft
Goffi <goffi@goffi.org>
parents:
diff changeset
38 else:
1113
cdd389ef97bc server: code style reformatting using black
Goffi <goffi@goffi.org>
parents: 1091
diff changeset
39 rdata["target"] = target_jid
996
d821c112e656 pages (chat): implementation of chat page using new dynamic pages, first draft
Goffi <goffi@goffi.org>
parents:
diff changeset
40
1000
4cc4d49e1d0f pages (chat): moved rendering preparation in prepare_render, and redirect to page_select if no jid is specified.
Goffi <goffi@goffi.org>
parents: 996
diff changeset
41
4cc4d49e1d0f pages (chat): moved rendering preparation in prepare_render, and redirect to page_select if no jid is specified.
Goffi <goffi@goffi.org>
parents: 996
diff changeset
42 @defer.inlineCallbacks
4cc4d49e1d0f pages (chat): moved rendering preparation in prepare_render, and redirect to page_select if no jid is specified.
Goffi <goffi@goffi.org>
parents: 996
diff changeset
43 def prepare_render(self, request):
1113
cdd389ef97bc server: code style reformatting using black
Goffi <goffi@goffi.org>
parents: 1091
diff changeset
44 #  FIXME: bug on room filtering (currently display messages from all rooms)
1000
4cc4d49e1d0f pages (chat): moved rendering preparation in prepare_render, and redirect to page_select if no jid is specified.
Goffi <goffi@goffi.org>
parents: 996
diff changeset
45 session = self.host.getSessionData(request, session_iface.ISATSession)
4cc4d49e1d0f pages (chat): moved rendering preparation in prepare_render, and redirect to page_select if no jid is specified.
Goffi <goffi@goffi.org>
parents: 996
diff changeset
46 template_data = request.template_data
4cc4d49e1d0f pages (chat): moved rendering preparation in prepare_render, and redirect to page_select if no jid is specified.
Goffi <goffi@goffi.org>
parents: 996
diff changeset
47 rdata = self.getRData(request)
1113
cdd389ef97bc server: code style reformatting using black
Goffi <goffi@goffi.org>
parents: 1091
diff changeset
48 target_jid = rdata["target"]
1000
4cc4d49e1d0f pages (chat): moved rendering preparation in prepare_render, and redirect to page_select if no jid is specified.
Goffi <goffi@goffi.org>
parents: 996
diff changeset
49 profile = session.profile
996
d821c112e656 pages (chat): implementation of chat page using new dynamic pages, first draft
Goffi <goffi@goffi.org>
parents:
diff changeset
50 profile_jid = session.jid
d821c112e656 pages (chat): implementation of chat page using new dynamic pages, first draft
Goffi <goffi@goffi.org>
parents:
diff changeset
51
1216
b2d067339de3 python 3 port:
Goffi <goffi@goffi.org>
parents: 1203
diff changeset
52 disco = yield self.host.bridgeCall("discoInfos", target_jid.host, "", True, profile)
996
d821c112e656 pages (chat): implementation of chat page using new dynamic pages, first draft
Goffi <goffi@goffi.org>
parents:
diff changeset
53 if "conference" in [i[0] for i in disco[1]]:
d821c112e656 pages (chat): implementation of chat page using new dynamic pages, first draft
Goffi <goffi@goffi.org>
parents:
diff changeset
54 chat_type = C.CHAT_GROUP
1113
cdd389ef97bc server: code style reformatting using black
Goffi <goffi@goffi.org>
parents: 1091
diff changeset
55 join_ret = yield self.host.bridgeCall(
1216
b2d067339de3 python 3 port:
Goffi <goffi@goffi.org>
parents: 1203
diff changeset
56 "mucJoin", target_jid.userhost(), "", "", profile
1113
cdd389ef97bc server: code style reformatting using black
Goffi <goffi@goffi.org>
parents: 1091
diff changeset
57 )
1232
4ccc5bb65be2 pages (chat): handle room statuses following backend change
Goffi <goffi@goffi.org>
parents: 1216
diff changeset
58 (already_joined,
4ccc5bb65be2 pages (chat): handle room statuses following backend change
Goffi <goffi@goffi.org>
parents: 1216
diff changeset
59 room_jid_s,
4ccc5bb65be2 pages (chat): handle room statuses following backend change
Goffi <goffi@goffi.org>
parents: 1216
diff changeset
60 occupants,
4ccc5bb65be2 pages (chat): handle room statuses following backend change
Goffi <goffi@goffi.org>
parents: 1216
diff changeset
61 user_nick,
4ccc5bb65be2 pages (chat): handle room statuses following backend change
Goffi <goffi@goffi.org>
parents: 1216
diff changeset
62 room_subject,
4ccc5bb65be2 pages (chat): handle room statuses following backend change
Goffi <goffi@goffi.org>
parents: 1216
diff changeset
63 room_statuses,
4ccc5bb65be2 pages (chat): handle room statuses following backend change
Goffi <goffi@goffi.org>
parents: 1216
diff changeset
64 __) = join_ret
1216
b2d067339de3 python 3 port:
Goffi <goffi@goffi.org>
parents: 1203
diff changeset
65 template_data["subject"] = room_subject
1232
4ccc5bb65be2 pages (chat): handle room statuses following backend change
Goffi <goffi@goffi.org>
parents: 1216
diff changeset
66 template_data["room_statuses"] = room_statuses
996
d821c112e656 pages (chat): implementation of chat page using new dynamic pages, first draft
Goffi <goffi@goffi.org>
parents:
diff changeset
67 own_jid = jid.JID(room_jid_s)
d821c112e656 pages (chat): implementation of chat page using new dynamic pages, first draft
Goffi <goffi@goffi.org>
parents:
diff changeset
68 own_jid.resource = user_nick
d821c112e656 pages (chat): implementation of chat page using new dynamic pages, first draft
Goffi <goffi@goffi.org>
parents:
diff changeset
69 else:
d821c112e656 pages (chat): implementation of chat page using new dynamic pages, first draft
Goffi <goffi@goffi.org>
parents:
diff changeset
70 chat_type = C.CHAT_ONE2ONE
d821c112e656 pages (chat): implementation of chat page using new dynamic pages, first draft
Goffi <goffi@goffi.org>
parents:
diff changeset
71 own_jid = profile_jid
1113
cdd389ef97bc server: code style reformatting using black
Goffi <goffi@goffi.org>
parents: 1091
diff changeset
72 rdata["chat_type"] = chat_type
cdd389ef97bc server: code style reformatting using black
Goffi <goffi@goffi.org>
parents: 1091
diff changeset
73 template_data["own_jid"] = own_jid
996
d821c112e656 pages (chat): implementation of chat page using new dynamic pages, first draft
Goffi <goffi@goffi.org>
parents:
diff changeset
74
1216
b2d067339de3 python 3 port:
Goffi <goffi@goffi.org>
parents: 1203
diff changeset
75 self.registerSignal(request, "messageNew")
1113
cdd389ef97bc server: code style reformatting using black
Goffi <goffi@goffi.org>
parents: 1091
diff changeset
76 history = yield self.host.bridgeCall(
1216
b2d067339de3 python 3 port:
Goffi <goffi@goffi.org>
parents: 1203
diff changeset
77 "historyGet",
1113
cdd389ef97bc server: code style reformatting using black
Goffi <goffi@goffi.org>
parents: 1091
diff changeset
78 profile_jid.userhost(),
cdd389ef97bc server: code style reformatting using black
Goffi <goffi@goffi.org>
parents: 1091
diff changeset
79 target_jid.userhost(),
cdd389ef97bc server: code style reformatting using black
Goffi <goffi@goffi.org>
parents: 1091
diff changeset
80 20,
cdd389ef97bc server: code style reformatting using black
Goffi <goffi@goffi.org>
parents: 1091
diff changeset
81 True,
cdd389ef97bc server: code style reformatting using black
Goffi <goffi@goffi.org>
parents: 1091
diff changeset
82 {},
cdd389ef97bc server: code style reformatting using black
Goffi <goffi@goffi.org>
parents: 1091
diff changeset
83 profile,
cdd389ef97bc server: code style reformatting using black
Goffi <goffi@goffi.org>
parents: 1091
diff changeset
84 )
996
d821c112e656 pages (chat): implementation of chat page using new dynamic pages, first draft
Goffi <goffi@goffi.org>
parents:
diff changeset
85 authors = {m[2] for m in history}
d821c112e656 pages (chat): implementation of chat page using new dynamic pages, first draft
Goffi <goffi@goffi.org>
parents:
diff changeset
86 identities = {}
d821c112e656 pages (chat): implementation of chat page using new dynamic pages, first draft
Goffi <goffi@goffi.org>
parents:
diff changeset
87 for author in authors:
1216
b2d067339de3 python 3 port:
Goffi <goffi@goffi.org>
parents: 1203
diff changeset
88 identities[author] = yield self.host.bridgeCall("identityGet", author, profile)
996
d821c112e656 pages (chat): implementation of chat page using new dynamic pages, first draft
Goffi <goffi@goffi.org>
parents:
diff changeset
89
1216
b2d067339de3 python 3 port:
Goffi <goffi@goffi.org>
parents: 1203
diff changeset
90 template_data["messages"] = data_objects.Messages(history)
b2d067339de3 python 3 port:
Goffi <goffi@goffi.org>
parents: 1203
diff changeset
91 rdata['identities'] = template_data["identities"] = identities
b2d067339de3 python 3 port:
Goffi <goffi@goffi.org>
parents: 1203
diff changeset
92 template_data["target_jid"] = target_jid
b2d067339de3 python 3 port:
Goffi <goffi@goffi.org>
parents: 1203
diff changeset
93 template_data["chat_type"] = chat_type
996
d821c112e656 pages (chat): implementation of chat page using new dynamic pages, first draft
Goffi <goffi@goffi.org>
parents:
diff changeset
94
d821c112e656 pages (chat): implementation of chat page using new dynamic pages, first draft
Goffi <goffi@goffi.org>
parents:
diff changeset
95
d821c112e656 pages (chat): implementation of chat page using new dynamic pages, first draft
Goffi <goffi@goffi.org>
parents:
diff changeset
96 def on_data(self, request, data):
d821c112e656 pages (chat): implementation of chat page using new dynamic pages, first draft
Goffi <goffi@goffi.org>
parents:
diff changeset
97 session = self.host.getSessionData(request, session_iface.ISATSession)
d821c112e656 pages (chat): implementation of chat page using new dynamic pages, first draft
Goffi <goffi@goffi.org>
parents:
diff changeset
98 rdata = self.getRData(request)
1113
cdd389ef97bc server: code style reformatting using black
Goffi <goffi@goffi.org>
parents: 1091
diff changeset
99 target = rdata["target"]
1216
b2d067339de3 python 3 port:
Goffi <goffi@goffi.org>
parents: 1203
diff changeset
100 data_type = data.get("type", "")
1113
cdd389ef97bc server: code style reformatting using black
Goffi <goffi@goffi.org>
parents: 1091
diff changeset
101 if data_type == "msg":
1216
b2d067339de3 python 3 port:
Goffi <goffi@goffi.org>
parents: 1203
diff changeset
102 message = data["body"]
1113
cdd389ef97bc server: code style reformatting using black
Goffi <goffi@goffi.org>
parents: 1091
diff changeset
103 mess_type = (
cdd389ef97bc server: code style reformatting using black
Goffi <goffi@goffi.org>
parents: 1091
diff changeset
104 C.MESS_TYPE_GROUPCHAT
cdd389ef97bc server: code style reformatting using black
Goffi <goffi@goffi.org>
parents: 1091
diff changeset
105 if rdata["chat_type"] == C.CHAT_GROUP
cdd389ef97bc server: code style reformatting using black
Goffi <goffi@goffi.org>
parents: 1091
diff changeset
106 else C.MESS_TYPE_CHAT
cdd389ef97bc server: code style reformatting using black
Goffi <goffi@goffi.org>
parents: 1091
diff changeset
107 )
1216
b2d067339de3 python 3 port:
Goffi <goffi@goffi.org>
parents: 1203
diff changeset
108 log.debug("message received: {}".format(message))
1113
cdd389ef97bc server: code style reformatting using black
Goffi <goffi@goffi.org>
parents: 1091
diff changeset
109 self.host.bridgeCall(
1216
b2d067339de3 python 3 port:
Goffi <goffi@goffi.org>
parents: 1203
diff changeset
110 "messageSend",
1113
cdd389ef97bc server: code style reformatting using black
Goffi <goffi@goffi.org>
parents: 1091
diff changeset
111 target.full(),
1216
b2d067339de3 python 3 port:
Goffi <goffi@goffi.org>
parents: 1203
diff changeset
112 {"": message},
1113
cdd389ef97bc server: code style reformatting using black
Goffi <goffi@goffi.org>
parents: 1091
diff changeset
113 {},
cdd389ef97bc server: code style reformatting using black
Goffi <goffi@goffi.org>
parents: 1091
diff changeset
114 mess_type,
cdd389ef97bc server: code style reformatting using black
Goffi <goffi@goffi.org>
parents: 1091
diff changeset
115 {},
cdd389ef97bc server: code style reformatting using black
Goffi <goffi@goffi.org>
parents: 1091
diff changeset
116 session.profile,
cdd389ef97bc server: code style reformatting using black
Goffi <goffi@goffi.org>
parents: 1091
diff changeset
117 )
996
d821c112e656 pages (chat): implementation of chat page using new dynamic pages, first draft
Goffi <goffi@goffi.org>
parents:
diff changeset
118 else:
1216
b2d067339de3 python 3 port:
Goffi <goffi@goffi.org>
parents: 1203
diff changeset
119 log.warning("unknown message type: {type}".format(type=data_type))
996
d821c112e656 pages (chat): implementation of chat page using new dynamic pages, first draft
Goffi <goffi@goffi.org>
parents:
diff changeset
120
d821c112e656 pages (chat): implementation of chat page using new dynamic pages, first draft
Goffi <goffi@goffi.org>
parents:
diff changeset
121
d821c112e656 pages (chat): implementation of chat page using new dynamic pages, first draft
Goffi <goffi@goffi.org>
parents:
diff changeset
122 @defer.inlineCallbacks
d821c112e656 pages (chat): implementation of chat page using new dynamic pages, first draft
Goffi <goffi@goffi.org>
parents:
diff changeset
123 def on_signal(self, request, signal, *args):
1113
cdd389ef97bc server: code style reformatting using black
Goffi <goffi@goffi.org>
parents: 1091
diff changeset
124 if signal == "messageNew":
1002
990e80aa43a9 pages (chat): fixed messages filtering + get identity of user if not already in cache.
Goffi <goffi@goffi.org>
parents: 1001
diff changeset
125 rdata = self.getRData(request)
1216
b2d067339de3 python 3 port:
Goffi <goffi@goffi.org>
parents: 1203
diff changeset
126 template_data_update = {"msg": data_objects.Message((args))}
1113
cdd389ef97bc server: code style reformatting using black
Goffi <goffi@goffi.org>
parents: 1091
diff changeset
127 target_jid = rdata["target"]
1203
251eba911d4d server (websockets): fixed websocket handling on HTTPS connections:
Goffi <goffi@goffi.org>
parents: 1145
diff changeset
128 identities = rdata["identities"]
1241
921e9f2a97af pages (chat): renamed `extra` argument to `extra_s` as it is now serialised
Goffi <goffi@goffi.org>
parents: 1232
diff changeset
129 uid, timestamp, from_jid_s, to_jid_s, message, subject, mess_type, extra_s, __ = (
1113
cdd389ef97bc server: code style reformatting using black
Goffi <goffi@goffi.org>
parents: 1091
diff changeset
130 args
cdd389ef97bc server: code style reformatting using black
Goffi <goffi@goffi.org>
parents: 1091
diff changeset
131 )
1002
990e80aa43a9 pages (chat): fixed messages filtering + get identity of user if not already in cache.
Goffi <goffi@goffi.org>
parents: 1001
diff changeset
132 from_jid = jid.JID(from_jid_s)
990e80aa43a9 pages (chat): fixed messages filtering + get identity of user if not already in cache.
Goffi <goffi@goffi.org>
parents: 1001
diff changeset
133 to_jid = jid.JID(to_jid_s)
1113
cdd389ef97bc server: code style reformatting using black
Goffi <goffi@goffi.org>
parents: 1091
diff changeset
134 if (
cdd389ef97bc server: code style reformatting using black
Goffi <goffi@goffi.org>
parents: 1091
diff changeset
135 target_jid.userhostJID() != from_jid.userhostJID()
cdd389ef97bc server: code style reformatting using black
Goffi <goffi@goffi.org>
parents: 1091
diff changeset
136 and target_jid.userhostJID() != to_jid.userhostJID()
cdd389ef97bc server: code style reformatting using black
Goffi <goffi@goffi.org>
parents: 1091
diff changeset
137 ):
1002
990e80aa43a9 pages (chat): fixed messages filtering + get identity of user if not already in cache.
Goffi <goffi@goffi.org>
parents: 1001
diff changeset
138 # the message is not linked with page's room/user
990e80aa43a9 pages (chat): fixed messages filtering + get identity of user if not already in cache.
Goffi <goffi@goffi.org>
parents: 1001
diff changeset
139 return
990e80aa43a9 pages (chat): fixed messages filtering + get identity of user if not already in cache.
Goffi <goffi@goffi.org>
parents: 1001
diff changeset
140
990e80aa43a9 pages (chat): fixed messages filtering + get identity of user if not already in cache.
Goffi <goffi@goffi.org>
parents: 1001
diff changeset
141 if from_jid_s not in identities:
990e80aa43a9 pages (chat): fixed messages filtering + get identity of user if not already in cache.
Goffi <goffi@goffi.org>
parents: 1001
diff changeset
142 profile = self.getProfile(request)
1113
cdd389ef97bc server: code style reformatting using black
Goffi <goffi@goffi.org>
parents: 1091
diff changeset
143 identities[from_jid_s] = yield self.host.bridgeCall(
1216
b2d067339de3 python 3 port:
Goffi <goffi@goffi.org>
parents: 1203
diff changeset
144 "identityGet", from_jid_s, profile
1113
cdd389ef97bc server: code style reformatting using black
Goffi <goffi@goffi.org>
parents: 1091
diff changeset
145 )
cdd389ef97bc server: code style reformatting using black
Goffi <goffi@goffi.org>
parents: 1091
diff changeset
146 template_data_update["identities"] = identities
cdd389ef97bc server: code style reformatting using black
Goffi <goffi@goffi.org>
parents: 1091
diff changeset
147 self.renderAndUpdate(
1216
b2d067339de3 python 3 port:
Goffi <goffi@goffi.org>
parents: 1203
diff changeset
148 request, "chat/message.html", "#messages", template_data_update
1113
cdd389ef97bc server: code style reformatting using black
Goffi <goffi@goffi.org>
parents: 1091
diff changeset
149 )
996
d821c112e656 pages (chat): implementation of chat page using new dynamic pages, first draft
Goffi <goffi@goffi.org>
parents:
diff changeset
150 else:
1216
b2d067339de3 python 3 port:
Goffi <goffi@goffi.org>
parents: 1203
diff changeset
151 log.error(_("Unexpected signal: {signal}").format(signal=signal))