diff options
author | Kim Alvefur <zash@zash.se> | 2020-11-07 21:39:36 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2020-11-07 21:39:36 +0100 |
commit | 317c76c881299712a6153ca0999ef288759d537b (patch) | |
tree | 3a0f03852beb9260e0149d02cb6d9d2a1480f8e8 /util | |
parent | 3f1d93bb4e377a320b4e3edb6c0a959e8f997bb2 (diff) | |
download | prosody-317c76c881299712a6153ca0999ef288759d537b.tar.gz prosody-317c76c881299712a6153ca0999ef288759d537b.zip |
util.stanza: Remove Windows "support" (disabling ANSI color pretty printing)
Always enable pretty printing if util.termcolours is available
util.termcolours can be nooped out to disable pretty printing.
Diffstat (limited to 'util')
-rw-r--r-- | util/stanza.lua | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/util/stanza.lua b/util/stanza.lua index 8ec49a39..3e76bd89 100644 --- a/util/stanza.lua +++ b/util/stanza.lua @@ -22,20 +22,10 @@ local type = type; local s_gsub = string.gsub; local s_sub = string.sub; local s_find = string.find; -local os = os; local valid_utf8 = require "util.encodings".utf8.valid; -local do_pretty_printing = not os.getenv("WINDIR"); -local getstyle, getstring; -if do_pretty_printing then - local ok, termcolours = pcall(require, "util.termcolours"); - if ok then - getstyle, getstring = termcolours.getstyle, termcolours.getstring; - else - do_pretty_printing = nil; - end -end +local do_pretty_printing, termcolours = pcall(require, "util.termcolours"); local xmlns_stanzas = "urn:ietf:params:xml:ns:xmpp-stanzas"; @@ -500,6 +490,7 @@ local function presence(attr) end if do_pretty_printing then + local getstyle, getstring = termcolours.getstyle, termcolours.getstring; local style_attrk = getstyle("yellow"); local style_attrv = getstyle("red"); local style_tagname = getstyle("red"); |