mirror of
https://github.com/opensim/opensim.git
synced 2026-08-08 02:05:34 +08:00
Add ability to silence IRC relay of region joins and quits from certain users This is useful for admins who wish to remain hidden, or service bots. Thanks RemedyTomm
This commit is contained in:
@@ -83,6 +83,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Chat
|
||||
|
||||
internal string _accessPassword = String.Empty;
|
||||
internal Regex AccessPasswordRegex = null;
|
||||
internal List<string> ExcludeList = new List<string>();
|
||||
internal string AccessPassword
|
||||
{
|
||||
get { return _accessPassword; }
|
||||
@@ -210,8 +211,13 @@ namespace OpenSim.Region.OptionalModules.Avatar.Chat
|
||||
m_log.DebugFormat("[IRC-Channel-{0}] PingDelay : <{1}>", cs.idn, cs.PingDelay);
|
||||
cs.AccessPassword = Substitute(rs, config.GetString("access_password", cs.AccessPassword));
|
||||
m_log.DebugFormat("[IRC-Channel-{0}] AccessPassword : <{1}>", cs.idn, cs.AccessPassword);
|
||||
|
||||
|
||||
string[] excludes = config.GetString("exclude_list", "").Trim().Split(new Char[] { ',' });
|
||||
cs.ExcludeList = new List<string>(excludes.Length);
|
||||
foreach(string name in excludes)
|
||||
{
|
||||
cs.ExcludeList.Add(name.Trim().ToLower());
|
||||
}
|
||||
|
||||
// Fail if fundamental information is still missing
|
||||
|
||||
if (cs.Server == null || cs.IrcChannel == null || cs.BaseNickname == null || cs.User == null)
|
||||
|
||||
@@ -145,7 +145,11 @@ namespace OpenSim.Region.OptionalModules.Avatar.Chat
|
||||
if (enabled && (cs.irc.Enabled) && (cs.irc.Connected) && (cs.ClientReporting))
|
||||
{
|
||||
m_log.InfoFormat("[IRC-Region {0}]: {1} has left", Region, client.Name);
|
||||
cs.irc.PrivMsg(cs.NoticeMessageFormat, cs.irc.Nick, Region, String.Format("{0} has left", client.Name));
|
||||
//Check if this person is excluded from IRC
|
||||
if (!cs.ExcludeList.Contains(client.Name.ToLower()))
|
||||
{
|
||||
cs.irc.PrivMsg(cs.NoticeMessageFormat, cs.irc.Nick, Region, String.Format("{0} has left", client.Name));
|
||||
}
|
||||
}
|
||||
client.OnLogout -= OnClientLoggedOut;
|
||||
client.OnConnectionClosed -= OnClientLoggedOut;
|
||||
@@ -209,7 +213,11 @@ namespace OpenSim.Region.OptionalModules.Avatar.Chat
|
||||
{
|
||||
string clientName = String.Format("{0} {1}", presence.Firstname, presence.Lastname);
|
||||
m_log.DebugFormat("[IRC-Region {0}] {1} has arrived", Region, clientName);
|
||||
cs.irc.PrivMsg(cs.NoticeMessageFormat, cs.irc.Nick, Region, String.Format("{0} has arrived", clientName));
|
||||
//Check if this person is excluded from IRC
|
||||
if (!cs.ExcludeList.Contains(clientName.ToLower()))
|
||||
{
|
||||
cs.irc.PrivMsg(cs.NoticeMessageFormat, cs.irc.Nick, Region, String.Format("{0} has arrived", clientName));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user