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
569f6a7c
Commit
569f6a7c
authored
5 years ago
by
Tulir Asokan
Browse files
Options
Downloads
Patches
Plain Diff
Fix bug where sending doesn't work after logging in before restarting
parent
df187ee0
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
mautrix_facebook/user.py
+5
-3
5 additions, 3 deletions
mautrix_facebook/user.py
with
5 additions
and
3 deletions
mautrix_facebook/user.py
+
5
−
3
View file @
569f6a7c
...
@@ -111,15 +111,15 @@ class User(Client):
...
@@ -111,15 +111,15 @@ class User(Client):
return
True
return
True
elif
not
self
.
_session_data
:
elif
not
self
.
_session_data
:
return
False
return
False
ok
=
await
self
.
setSession
(
self
.
_session_data
)
and
await
self
.
is_logged_in
()
ok
=
await
self
.
setSession
(
self
.
_session_data
)
and
await
self
.
is_logged_in
(
True
)
if
ok
:
if
ok
:
self
.
log
.
info
(
"
Loaded session successfully
"
)
self
.
log
.
info
(
"
Loaded session successfully
"
)
self
.
listen
()
self
.
listen
()
asyncio
.
ensure_future
(
self
.
post_login
(),
loop
=
self
.
loop
)
asyncio
.
ensure_future
(
self
.
post_login
(),
loop
=
self
.
loop
)
return
ok
return
ok
async
def
is_logged_in
(
self
)
->
bool
:
async
def
is_logged_in
(
self
,
_override
:
bool
=
False
)
->
bool
:
if
self
.
_is_logged_in
is
None
:
if
self
.
_is_logged_in
is
None
or
_override
:
self
.
_is_logged_in
=
await
self
.
isLoggedIn
()
self
.
_is_logged_in
=
await
self
.
isLoggedIn
()
return
self
.
_is_logged_in
return
self
.
_is_logged_in
...
@@ -128,6 +128,7 @@ class User(Client):
...
@@ -128,6 +128,7 @@ class User(Client):
async
def
logout
(
self
)
->
bool
:
async
def
logout
(
self
)
->
bool
:
ok
=
await
super
().
logout
()
ok
=
await
super
().
logout
()
self
.
_session_data
=
None
self
.
_session_data
=
None
self
.
_is_logged_in
=
False
self
.
save
(
_update_session_data
=
False
)
self
.
save
(
_update_session_data
=
False
)
return
ok
return
ok
...
@@ -177,6 +178,7 @@ class User(Client):
...
@@ -177,6 +178,7 @@ class User(Client):
:param email: The email of the client
:param email: The email of the client
"""
"""
self
.
_is_logged_in
=
True
if
self
.
command_status
and
self
.
command_status
.
get
(
"
action
"
,
""
)
==
"
Login
"
:
if
self
.
command_status
and
self
.
command_status
.
get
(
"
action
"
,
""
)
==
"
Login
"
:
await
self
.
az
.
intent
.
send_notice
(
self
.
command_status
[
"
room_id
"
],
await
self
.
az
.
intent
.
send_notice
(
self
.
command_status
[
"
room_id
"
],
f
"
Successfully logged in with
{
email
}
"
)
f
"
Successfully logged in with
{
email
}
"
)
...
...
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