Show current location on login.
This commit is contained in:
parent
86278e890d
commit
8b628eb831
@ -256,6 +256,12 @@ impl DBTrans {
|
||||
WHERE username = $2 AND current_session IS NOT NULL \
|
||||
AND current_listener IS NOT NULL",
|
||||
&[&"Logged in from another session\r\n", &username_l]).await?;
|
||||
self.pg_trans()?
|
||||
.execute("INSERT INTO sendqueue (session, listener, message) \
|
||||
SELECT current_session, current_listener, null FROM users \
|
||||
WHERE username = $1 AND current_session IS NOT NULL \
|
||||
AND current_listener IS NOT NULL",
|
||||
&[&username_l]).await?;
|
||||
self.pg_trans()?
|
||||
.execute("UPDATE users SET current_session = $1, current_listener = $2 WHERE username = $3",
|
||||
&[&session.session as &(dyn ToSql + Sync), &session.listener, &username_l]).await?;
|
||||
|
@ -1,4 +1,5 @@
|
||||
use super::{VerbContext, UserVerb, UserVerbRef, UResult, user_error};
|
||||
use super::look;
|
||||
use async_trait::async_trait;
|
||||
use tokio::time;
|
||||
|
||||
@ -27,6 +28,7 @@ impl UserVerb for Verb {
|
||||
super::agree::check_and_notify_accepts(ctx).await?;
|
||||
if let Some(user) = ctx.user_dat {
|
||||
ctx.trans.save_user_model(user).await?;
|
||||
look::VERB.handle(ctx, "look", "").await?;
|
||||
}
|
||||
|
||||
Ok(())
|
||||
|
Loading…
Reference in New Issue
Block a user