Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
facebook
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
mautrix
facebook
Commits
a4cc0822
Commit
a4cc0822
authored
4 years ago
by
Tulir Asokan
Browse files
Options
Downloads
Patches
Plain Diff
Fix sync warning when stopping bridge
parent
1664bebf
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
mautrix_facebook/__main__.py
+9
-3
9 additions, 3 deletions
mautrix_facebook/__main__.py
mautrix_facebook/user.py
+2
-1
2 additions, 1 deletion
mautrix_facebook/user.py
with
11 additions
and
4 deletions
mautrix_facebook/__main__.py
+
9
−
3
View file @
a4cc0822
...
...
@@ -62,14 +62,19 @@ class MessengerBridge(Bridge):
self
.
public_website
=
PublicBridgeWebsite
(
self
.
config
[
"
appservice.public.shared_secret
"
])
self
.
az
.
app
.
add_subapp
(
self
.
config
[
"
appservice.public.prefix
"
],
self
.
public_website
.
app
)
def
prepare_s
hutdown
(
self
)
->
None
:
def
prepare_s
top
(
self
)
->
None
:
self
.
periodic_reconnect_task
.
cancel
()
self
.
log
.
debug
(
"
Stopping puppet syncers
"
)
for
puppet
in
Puppet
.
by_custom_mxid
.
values
():
puppet
.
stop
()
self
.
log
.
debug
(
"
Saving user sessions and stopping listeners
"
)
for
mxid
,
user
in
User
.
by_mxid
.
items
():
self
.
log
.
debug
(
"
Stopping facebook listeners
"
)
User
.
shutdown
=
True
for
user
in
User
.
by_fbid
.
values
():
user
.
stop_listening
()
def
prepare_shutdown
(
self
)
->
None
:
self
.
log
.
debug
(
"
Saving user sessions
"
)
for
user
in
User
.
by_mxid
.
values
():
user
.
save
()
async
def
start
(
self
)
->
None
:
...
...
@@ -144,4 +149,5 @@ class MessengerBridge(Bridge):
def
is_bridge_ghost
(
self
,
user_id
:
UserID
)
->
bool
:
return
bool
(
Puppet
.
get_id_from_mxid
(
user_id
))
MessengerBridge
().
run
()
This diff is collapsed.
Click to expand it.
mautrix_facebook/user.py
+
2
−
1
View file @
a4cc0822
...
...
@@ -46,6 +46,7 @@ config: Config
class
User
(
BaseUser
):
temp_disconnect_notices
:
bool
=
True
shutdown
:
bool
=
False
by_mxid
:
Dict
[
UserID
,
'
User
'
]
=
{}
by_fbid
:
Dict
[
str
,
'
User
'
]
=
{}
...
...
@@ -526,7 +527,7 @@ class User(BaseUser):
async
for
event
in
self
.
listener
.
listen
():
await
self
.
_handle_event
(
event
)
self
.
is_connected
=
False
if
not
self
.
_is_refreshing
:
if
not
self
.
_is_refreshing
and
not
self
.
shutdown
:
await
self
.
send_bridge_notice
(
"
Facebook Messenger connection closed without error
"
)
async
def
_handle_event
(
self
,
event
:
Any
)
->
None
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment