(wip) many things don't work
This commit is contained in:
parent
0d54b5acdb
commit
7e0dbc5824
3 changed files with 14 additions and 4 deletions
10
Dockerfile
10
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
|
RUN mkdir /app
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
ADD static /app/static
|
ADD static /app/static
|
||||||
ADD easybridge.jpg /app/easybridge.jpg
|
ADD easybridge.jpg /app/easybridge.jpg
|
||||||
|
ADD external /app/external
|
||||||
ADD easybridge /app/easybridge
|
ADD easybridge /app/easybridge
|
||||||
ADD templates /app/templates
|
ADD templates /app/templates
|
||||||
|
|
||||||
ENTRYPOINT ["/app/easybridge"]
|
CMD "/app/easybridge"
|
||||||
|
|
1
connector/external/external.go
vendored
1
connector/external/external.go
vendored
|
@ -354,6 +354,7 @@ func (ext *External) handleCmd(msg *extMessageWithData) {
|
||||||
ext.sendJson.Encode(&extMessage{
|
ext.sendJson.Encode(&extMessage{
|
||||||
MsgType: REP_OK,
|
MsgType: REP_OK,
|
||||||
MsgId: msg.MsgId,
|
MsgId: msg.MsgId,
|
||||||
|
Key: msg.Key,
|
||||||
Value: value,
|
Value: value,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
7
external/messenger.py
vendored
7
external/messenger.py
vendored
|
@ -330,12 +330,12 @@ class MessengerBridge:
|
||||||
|
|
||||||
def ensure_i_joined(self, thread_id):
|
def ensure_i_joined(self, thread_id):
|
||||||
if thread_id not in self.my_joined_rooms:
|
if thread_id not in self.my_joined_rooms:
|
||||||
|
self.my_joined_rooms[thread_id] = True
|
||||||
|
|
||||||
thread = self.client.fetchThreadInfo(thread_id)[thread_id]
|
thread = self.client.fetchThreadInfo(thread_id)[thread_id]
|
||||||
self.setup_joined_thread(thread)
|
self.setup_joined_thread(thread)
|
||||||
|
|
||||||
def setup_joined_thread(self, thread):
|
def setup_joined_thread(self, thread):
|
||||||
self.my_joined_rooms[thread.uid] = True
|
|
||||||
|
|
||||||
if thread.type == ThreadType.GROUP:
|
if thread.type == ThreadType.GROUP:
|
||||||
members = self.client.fetchAllUsersFromThreads([thread])
|
members = self.client.fetchAllUsersFromThreads([thread])
|
||||||
|
|
||||||
|
@ -351,6 +351,8 @@ class MessengerBridge:
|
||||||
|
|
||||||
|
|
||||||
def send_room_info(self, thread, members):
|
def send_room_info(self, thread, members):
|
||||||
|
members.sort(key=lambda m: m.uid)
|
||||||
|
|
||||||
room_info = {}
|
room_info = {}
|
||||||
if thread.name is not None:
|
if thread.name is not None:
|
||||||
room_info["name"] = thread.name
|
room_info["name"] = thread.name
|
||||||
|
@ -436,6 +438,7 @@ class MessengerBridge:
|
||||||
author = self.getUserIdFromUid(message_object.author)
|
author = self.getUserIdFromUid(message_object.author)
|
||||||
|
|
||||||
event = {
|
event = {
|
||||||
|
"id": message_object.uid,
|
||||||
"type": EVENT_MESSAGE,
|
"type": EVENT_MESSAGE,
|
||||||
"author": author,
|
"author": author,
|
||||||
"text": message_object.text,
|
"text": message_object.text,
|
||||||
|
|
Loading…
Reference in a new issue