xmpp: make Agent.config accessible only via getter
It may not matter much for the moment as this struct shouldn't change very much during the life of the client, but this prevents the lock from being held too long. Signed-off-by: pep <pep@bouah.net>
This commit is contained in:
parent
a1a31ce11c
commit
e22daa91f1
7 changed files with 17 additions and 12 deletions
|
|
@ -78,8 +78,7 @@ pub async fn join_room<'a>(agent: &mut Agent, settings: JoinRoomSettings<'a>) {
|
|||
let nick = if let Some(nick) = nick {
|
||||
nick
|
||||
} else {
|
||||
let config = agent.config.read().await;
|
||||
config.default_nick.clone()
|
||||
agent.get_config().await.default_nick
|
||||
};
|
||||
|
||||
let room_jid = room.with_resource(&nick);
|
||||
|
|
|
|||
Loading…
Reference in a new issue