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
6ba18c45
Commit
6ba18c45
authored
5 years ago
by
Tulir Asokan
Browse files
Options
Downloads
Patches
Plain Diff
Fix handling messages that only contain ShareAttachments
parent
e782333e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
mautrix_facebook/portal.py
+5
-1
5 additions, 1 deletion
mautrix_facebook/portal.py
with
5 additions
and
1 deletion
mautrix_facebook/portal.py
+
5
−
1
View file @
6ba18c45
...
@@ -553,7 +553,8 @@ class Portal(BasePortal):
...
@@ -553,7 +553,8 @@ class Portal(BasePortal):
for
attachment
in
message
.
attachments
])
for
attachment
in
message
.
attachments
])
event_ids
+=
[
attach_id
for
attach_id
in
attach_ids
if
attach_id
]
event_ids
+=
[
attach_id
for
attach_id
in
attach_ids
if
attach_id
]
if
not
event_ids
:
if
not
event_ids
:
if
message
.
text
:
if
message
.
text
or
any
(
x
for
x
in
message
.
attachments
if
isinstance
(
x
,
ShareAttachment
)):
event_ids
=
[
await
self
.
_handle_facebook_text
(
intent
,
message
)]
event_ids
=
[
await
self
.
_handle_facebook_text
(
intent
,
message
)]
else
:
else
:
self
.
log
.
warning
(
f
"
Unhandled Messenger message:
{
message
}
"
)
self
.
log
.
warning
(
f
"
Unhandled Messenger message:
{
message
}
"
)
...
@@ -634,6 +635,9 @@ class Portal(BasePortal):
...
@@ -634,6 +635,9 @@ class Portal(BasePortal):
content
=
await
self
.
_convert_facebook_location
(
intent
,
attachment
)
content
=
await
self
.
_convert_facebook_location
(
intent
,
attachment
)
content
.
relates_to
=
self
.
_get_facebook_reply
(
reply_to
)
content
.
relates_to
=
self
.
_get_facebook_reply
(
reply_to
)
event_id
=
await
self
.
_send_message
(
intent
,
content
)
event_id
=
await
self
.
_send_message
(
intent
,
content
)
elif
isinstance
(
attachment
,
ShareAttachment
):
# These are handled in the text formatter
return
None
else
:
else
:
self
.
log
.
warning
(
f
"
Unsupported attachment type:
{
attachment
}
"
)
self
.
log
.
warning
(
f
"
Unsupported attachment type:
{
attachment
}
"
)
return
None
return
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