aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2020-03-01 22:12:43 +0100
committerAlex Auvolat <alex@adnab.me>2020-03-01 22:12:43 +0100
commit7e0dbc5824a634875655be86098f95e8e3122d47 (patch)
treea8d0065fada2aea9706cdd940a51c8e5c1d9cc49
parent0d54b5acdb2cb22042039c9cdcdcfc71f62a5954 (diff)
downloadeasybridge-7e0dbc5824a634875655be86098f95e8e3122d47.tar.gz
easybridge-7e0dbc5824a634875655be86098f95e8e3122d47.zip
(wip) many things don't work
-rw-r--r--Dockerfile10
-rw-r--r--connector/external/external.go1
-rwxr-xr-xexternal/messenger.py7
3 files changed, 14 insertions, 4 deletions
diff --git a/Dockerfile b/Dockerfile
index b76d5b8..28d0eef 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,10 +1,16 @@
-FROM archlinux:latest
+#FROM archlinux:latest
+#RUN pacman -Sy python-pip --noconfirm; pacman -Scc --noconfirm
+
+FROM python:3.8-buster
+
+RUN pip install fbchat
RUN mkdir /app
WORKDIR /app
ADD static /app/static
ADD easybridge.jpg /app/easybridge.jpg
+ADD external /app/external
ADD easybridge /app/easybridge
ADD templates /app/templates
-ENTRYPOINT ["/app/easybridge"]
+CMD "/app/easybridge"
diff --git a/connector/external/external.go b/connector/external/external.go
index 6d25230..6117880 100644
--- a/connector/external/external.go
+++ b/connector/external/external.go
@@ -354,6 +354,7 @@ func (ext *External) handleCmd(msg *extMessageWithData) {
ext.sendJson.Encode(&extMessage{
MsgType: REP_OK,
MsgId: msg.MsgId,
+ Key: msg.Key,
Value: value,
})
}
diff --git a/external/messenger.py b/external/messenger.py
index 9728c9d..f8f1a43 100755
--- a/external/messenger.py
+++ b/external/messenger.py
@@ -330,12 +330,12 @@ class MessengerBridge:
def ensure_i_joined(self, thread_id):
if thread_id not in self.my_joined_rooms:
+ self.my_joined_rooms[thread_id] = True
+
thread = self.client.fetchThreadInfo(thread_id)[thread_id]
self.setup_joined_thread(thread)
def setup_joined_thread(self, thread):
- self.my_joined_rooms[thread.uid] = True
-
if thread.type == ThreadType.GROUP:
members = self.client.fetchAllUsersFromThreads([thread])
@@ -351,6 +351,8 @@ class MessengerBridge:
def send_room_info(self, thread, members):
+ members.sort(key=lambda m: m.uid)
+
room_info = {}
if thread.name is not None:
room_info["name"] = thread.name
@@ -436,6 +438,7 @@ class MessengerBridge:
author = self.getUserIdFromUid(message_object.author)
event = {
+ "id": message_object.uid,
"type": EVENT_MESSAGE,
"author": author,
"text": message_object.text,