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
4378c8ce
Commit
4378c8ce
authored
5 years ago
by
Tulir Asokan
Browse files
Options
Downloads
Patches
Plain Diff
Make number of chats to sync configurable
parent
75edda6b
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
example-config.yaml
+3
-0
3 additions, 0 deletions
example-config.yaml
mautrix_facebook/config.py
+1
-0
1 addition, 0 deletions
mautrix_facebook/config.py
mautrix_facebook/user.py
+4
-1
4 additions, 1 deletion
mautrix_facebook/user.py
with
8 additions
and
1 deletion
example-config.yaml
+
3
−
0
View file @
4378c8ce
...
...
@@ -50,6 +50,9 @@ bridge:
# The prefix for commands. Only required in non-management rooms.
command_prefix
:
"
!fb"
# Number of chats to sync (and create portals for) on startup/login.
# Maximum 20, set 0 to disable automatic syncing.
initial_chat_sync
:
10
# Whether or not the Facebook users of logged in Matrix users should be
# invited to private chats when the user sends a message from another client.
invite_own_puppet_to_pm
:
false
...
...
This diff is collapsed.
Click to expand it.
mautrix_facebook/config.py
+
1
−
0
View file @
4378c8ce
...
...
@@ -66,6 +66,7 @@ class Config(BaseFileConfig):
copy
(
"
bridge.command_prefix
"
)
copy
(
"
bridge.initial_chat_sync
"
)
copy
(
"
bridge.invite_own_puppet_to_pm
"
)
copy
(
"
bridge.sync_with_custom_puppets
"
)
copy
(
"
bridge.presence
"
)
...
...
This diff is collapsed.
Click to expand it.
mautrix_facebook/user.py
+
4
−
1
View file @
4378c8ce
...
...
@@ -143,8 +143,11 @@ class User(Client):
async
def
sync_threads
(
self
)
->
None
:
try
:
sync_count
=
min
(
20
,
config
[
"
bridge.initial_chat_sync
"
])
if
sync_count
<=
0
:
return
self
.
log
.
debug
(
"
Fetching threads...
"
)
threads
=
await
self
.
fetchThreadList
(
limit
=
10
)
threads
=
await
self
.
fetchThreadList
(
limit
=
sync_count
)
for
thread
in
threads
:
self
.
log
.
debug
(
f
"
Syncing thread
{
thread
.
uid
}
{
thread
.
name
}
"
)
fb_receiver
=
self
.
uid
if
thread
.
type
==
ThreadType
.
USER
else
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