chat: add option to show channel names

This commit is contained in:
greenya
2017-05-26 16:17:06 +02:00
committed by shagu
parent a7f6e0abe1
commit 83bb05f616
3 changed files with 11 additions and 7 deletions
+9 -7
View File
@@ -702,13 +702,15 @@ pfUI:RegisterModule("chat", function ()
text = string.gsub(text, "|Hplayer:(.-)|h%[.-%]|h(.-:-)", "[|Hplayer:%1|h" .. Name .. "|h]" .. "%2")
end
local pattern = "%]%s+(.*|Hplayer)"
local channel = string.gsub(text, ".*%[(.-)" .. pattern ..".+", "%1")
if string.find(channel, "%d+%. ") then
channel = string.gsub(channel, "(%d+)%..*", "channel%1")
channel = string.gsub(channel, "channel", "")
pattern = "%[%d+%..-" .. pattern
text = string.gsub(text, pattern, "["..channel.."] ".."%1")
if C.chat.text.channelnumonly == "1" then
local pattern = "%]%s+(.*|Hplayer)"
local channel = string.gsub(text, ".*%[(.-)" .. pattern ..".+", "%1")
if string.find(channel, "%d+%. ") then
channel = string.gsub(channel, "(%d+)%..*", "channel%1")
channel = string.gsub(channel, "channel", "")
pattern = "%[%d+%..-" .. pattern
text = string.gsub(text, pattern, "["..channel.."] ".."%1")
end
end
-- show timestamp in chat