mirror of
https://github.com/ergochat/ergo.git
synced 2025-11-09 18:37:23 +01:00
parent
7256d83ff0
commit
9791606f62
@ -946,6 +946,12 @@ roleplay:
|
|||||||
# add the real nickname, in parentheses, to the end of every roleplay message?
|
# add the real nickname, in parentheses, to the end of every roleplay message?
|
||||||
add-suffix: true
|
add-suffix: true
|
||||||
|
|
||||||
|
# allow customizing the NUH's sent for NPC and SCENE commands
|
||||||
|
# NPC: the first %s is the NPC name, the second is the user's real nick
|
||||||
|
#npc-nick-mask: "*%s*!%s@npc.fakeuser.invalid"
|
||||||
|
# SCENE: the %s is the client's real nick
|
||||||
|
#scene-nick-mask: "=Scene=!%s@npc.fakeuser.invalid"
|
||||||
|
|
||||||
# external services can integrate with the ircd using JSON Web Tokens (https://jwt.io).
|
# external services can integrate with the ircd using JSON Web Tokens (https://jwt.io).
|
||||||
# in effect, the server can sign a token attesting that the client is present on
|
# in effect, the server can sign a token attesting that the client is present on
|
||||||
# the server, is a member of a particular channel, etc.
|
# the server, is a member of a particular channel, etc.
|
||||||
|
|||||||
@ -627,6 +627,8 @@ type Config struct {
|
|||||||
RequireOper bool `yaml:"require-oper"`
|
RequireOper bool `yaml:"require-oper"`
|
||||||
AddSuffix *bool `yaml:"add-suffix"`
|
AddSuffix *bool `yaml:"add-suffix"`
|
||||||
addSuffix bool
|
addSuffix bool
|
||||||
|
NPCNickMask string `yaml:"npc-nick-mask"`
|
||||||
|
SceneNickMask string `yaml:"scene-nick-mask"`
|
||||||
}
|
}
|
||||||
|
|
||||||
Extjwt struct {
|
Extjwt struct {
|
||||||
@ -1611,6 +1613,12 @@ func LoadConfig(filename string) (config *Config, err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
config.Roleplay.addSuffix = utils.BoolDefaultTrue(config.Roleplay.AddSuffix)
|
config.Roleplay.addSuffix = utils.BoolDefaultTrue(config.Roleplay.AddSuffix)
|
||||||
|
if config.Roleplay.NPCNickMask == "" {
|
||||||
|
config.Roleplay.NPCNickMask = defaultNPCNickMask
|
||||||
|
}
|
||||||
|
if config.Roleplay.SceneNickMask == "" {
|
||||||
|
config.Roleplay.SceneNickMask = defaultSceneNickMask
|
||||||
|
}
|
||||||
|
|
||||||
config.Datastore.MySQL.ExpireTime = time.Duration(config.History.Restrictions.ExpireTime)
|
config.Datastore.MySQL.ExpireTime = time.Duration(config.History.Restrictions.ExpireTime)
|
||||||
config.Datastore.MySQL.TrackAccountMessages = config.History.Retention.EnableAccountIndexing
|
config.Datastore.MySQL.TrackAccountMessages = config.History.Retention.EnableAccountIndexing
|
||||||
|
|||||||
@ -13,8 +13,8 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
npcNickMask = "*%s*!%s@npc.fakeuser.invalid"
|
defaultNPCNickMask = "*%s*!%s@npc.fakeuser.invalid"
|
||||||
sceneNickMask = "=Scene=!%s@npc.fakeuser.invalid"
|
defaultSceneNickMask = "=Scene=!%s@npc.fakeuser.invalid"
|
||||||
)
|
)
|
||||||
|
|
||||||
func sendRoleplayMessage(server *Server, client *Client, source string, targetString string, isScene, isAction bool, messageParts []string, rb *ResponseBuffer) {
|
func sendRoleplayMessage(server *Server, client *Client, source string, targetString string, isScene, isAction bool, messageParts []string, rb *ResponseBuffer) {
|
||||||
@ -30,7 +30,7 @@ func sendRoleplayMessage(server *Server, client *Client, source string, targetSt
|
|||||||
|
|
||||||
var sourceMask string
|
var sourceMask string
|
||||||
if isScene {
|
if isScene {
|
||||||
sourceMask = fmt.Sprintf(sceneNickMask, client.Nick())
|
sourceMask = fmt.Sprintf(server.Config().Roleplay.SceneNickMask, client.Nick())
|
||||||
} else {
|
} else {
|
||||||
cfSource, cfSourceErr := CasefoldName(source)
|
cfSource, cfSourceErr := CasefoldName(source)
|
||||||
skelSource, skelErr := Skeleton(source)
|
skelSource, skelErr := Skeleton(source)
|
||||||
@ -39,7 +39,7 @@ func sendRoleplayMessage(server *Server, client *Client, source string, targetSt
|
|||||||
rb.Add(nil, client.server.name, ERR_CANNOTSENDRP, targetString, client.t("Invalid roleplay name"))
|
rb.Add(nil, client.server.name, ERR_CANNOTSENDRP, targetString, client.t("Invalid roleplay name"))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
sourceMask = fmt.Sprintf(npcNickMask, source, client.Nick())
|
sourceMask = fmt.Sprintf(server.Config().Roleplay.NPCNickMask, source, client.Nick())
|
||||||
}
|
}
|
||||||
|
|
||||||
// block attempts to send CTCP messages to Tor clients
|
// block attempts to send CTCP messages to Tor clients
|
||||||
|
|||||||
@ -917,6 +917,12 @@ roleplay:
|
|||||||
# add the real nickname, in parentheses, to the end of every roleplay message?
|
# add the real nickname, in parentheses, to the end of every roleplay message?
|
||||||
add-suffix: true
|
add-suffix: true
|
||||||
|
|
||||||
|
# allow customizing the NUH's sent for NPC and SCENE commands
|
||||||
|
# NPC: the first %s is the NPC name, the second is the user's real nick
|
||||||
|
#npc-nick-mask: "*%s*!%s@npc.fakeuser.invalid"
|
||||||
|
# SCENE: the %s is the client's real nick
|
||||||
|
#scene-nick-mask: "=Scene=!%s@npc.fakeuser.invalid"
|
||||||
|
|
||||||
# external services can integrate with the ircd using JSON Web Tokens (https://jwt.io).
|
# external services can integrate with the ircd using JSON Web Tokens (https://jwt.io).
|
||||||
# in effect, the server can sign a token attesting that the client is present on
|
# in effect, the server can sign a token attesting that the client is present on
|
||||||
# the server, is a member of a particular channel, etc.
|
# the server, is a member of a particular channel, etc.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user