Skip to content

Commit ce4a2f6

Browse files
committed
Add convar custom_chat_always_allow_embeds, fixes #42
1 parent c6d9357 commit ce4a2f6

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

lua/autorun/sh_custom_chat.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@ CreateConVar( "custom_chat_enable_friend_messages", "1", bit.bor( FCVAR_ARCHIVE,
7373
CreateConVar( "custom_chat_enable_dms", "1", bit.bor( FCVAR_ARCHIVE, FCVAR_REPLICATED, FCVAR_NOTIFY ),
7474
"Allow players to chat with eachother privately.", 0, 1 )
7575

76+
CreateConVar( "custom_chat_always_allow_embeds", "0", bit.bor( FCVAR_ARCHIVE, FCVAR_REPLICATED, FCVAR_NOTIFY ),
77+
"Allows embeds to be displayed on the chat, even if the message did not come from a player.", 0, 1 )
78+
7679
if CLIENT then
7780
CreateClientConVar( "custom_chat_enable", "1", true, false )
7881

lua/custom_chat/client/block_types.lua

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -557,8 +557,7 @@ end
557557

558558
blocks["url"] = function( value, ctx )
559559
local urlType = GetURLType( value )
560-
local canEmbed = false
561-
560+
local canEmbed = CustomChat.GetConVarInt( "always_allow_embeds", 0 ) > 0
562561
local lastMessage = CustomChat.lastReceivedMessage
563562

564563
if lastMessage and IsValid( lastMessage.speaker ) then

0 commit comments

Comments
 (0)