aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2021-03-18 16:23:47 +0100
committerKim Alvefur <zash@zash.se>2021-03-18 16:23:47 +0100
commit846862e1e703be347136f5e3fe81e4c958cb8635 (patch)
treec0b74ad9c4bada3f9891ee90de911c814607355a /plugins
parentb5f808c769e384bed666e92a221516f424f55fae (diff)
downloadprosody-846862e1e703be347136f5e3fe81e4c958cb8635.tar.gz
prosody-846862e1e703be347136f5e3fe81e4c958cb8635.zip
mod_c2s: Improve code style
We don't use the quoted table indexing style that often, it's not needed here and it's enough to check for falsyness rather than `nil`.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_c2s.lua8
1 files changed, 6 insertions, 2 deletions
diff --git a/plugins/mod_c2s.lua b/plugins/mod_c2s.lua
index f3259ed2..57b7b0f7 100644
--- a/plugins/mod_c2s.lua
+++ b/plugins/mod_c2s.lua
@@ -226,11 +226,15 @@ module:hook_global("user-password-changed", function(event)
end, 200);
function runner_callbacks:ready()
- if self.data["conn"] ~= nil then self.data.conn:resume(); end
+ if self.data.conn then
+ self.data.conn:resume();
+ end
end
function runner_callbacks:waiting()
- if self.data["conn"] ~= nil then self.data.conn:pause(); end
+ if self.data.conn then
+ self.data.conn:pause();
+ end
end
function runner_callbacks:error(err)