{
if (string.IsNullOrEmpty(e.Message)) return;
+ // Check if the sender agent is muted
+ if (e.SourceType == ChatSourceType.Agent &&
+ null != client.Self.MuteList.Find(me => me.Type == MuteType.Resident && me.ID == e.SourceID)
+ ) return;
+
+ // Check if sender object is muted
+ if (e.SourceType == ChatSourceType.Object &&
+ null != client.Self.MuteList.Find(me =>
+ (me.Type == MuteType.Resident && me.ID == e.OwnerID) // Owner muted
+ || (me.Type == MuteType.Object && me.ID == e.SourceID) // Object muted by ID
+ || (me.Type == MuteType.ByName && me.Name == e.FromName) // Object muted by name
+ )) return;
+
if (instance.RLV.Enabled && e.Message.StartsWith("@"))
{
instance.RLV.TryProcessCMD(e);
}
ProcessBufferItem(item, true);
+ instance.TabConsole.Tabs["chat"].Highlight();
+
sb = null;
}
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
+ if (InvokeRequired)
+ {
+ if (!instance.MonoRuntime || IsHandleCreated)
+ {
+ Invoke(new System.Windows.Forms.MethodInvoker(() => Dispose(disposing)));
+ }
+ return;
+ }
+
if (disposing && (components != null))
{
components.Dispose();
netcom.ClientLoginStatus += new EventHandler<LoginProgressEventArgs>(netcom_ClientLoginStatus);
netcom.ClientLoggedOut += new EventHandler(netcom_ClientLoggedOut);
netcom.ClientDisconnected += new EventHandler<DisconnectedEventArgs>(netcom_ClientDisconnected);
- netcom.ChatReceived += new EventHandler<ChatEventArgs>(netcom_ChatReceived);
netcom.ChatSent += new EventHandler<ChatSentEventArgs>(netcom_ChatSent);
netcom.AlertMessageReceived += new EventHandler<AlertMessageEventArgs>(netcom_AlertMessageReceived);
netcom.InstantMessageReceived += new EventHandler<InstantMessageEventArgs>(netcom_InstantMessageReceived);
netcom.ClientLoginStatus -= new EventHandler<LoginProgressEventArgs>(netcom_ClientLoginStatus);
netcom.ClientLoggedOut -= new EventHandler(netcom_ClientLoggedOut);
netcom.ClientDisconnected -= new EventHandler<DisconnectedEventArgs>(netcom_ClientDisconnected);
- netcom.ChatReceived -= new EventHandler<ChatEventArgs>(netcom_ChatReceived);
netcom.ChatSent -= new EventHandler<ChatSentEventArgs>(netcom_ChatSent);
netcom.AlertMessageReceived -= new EventHandler<AlertMessageEventArgs>(netcom_AlertMessageReceived);
netcom.InstantMessageReceived -= new EventHandler<InstantMessageEventArgs>(netcom_InstantMessageReceived);
{
// Is this object muted
if (null != client.Self.MuteList.Find(m => (m.Type == MuteType.Object && m.ID == e.ObjectID) // muted object by id
- || (m.Type == MuteType.ByName && m.Name == e.ObjectName))) return;
+ || (m.Type == MuteType.ByName && m.Name == e.ObjectName) // object muted by name
+ )) return;
+
instance.MainForm.AddNotification(new ntfScriptDialog(instance, e.Message, e.ObjectName, e.ImageID, e.ObjectID, e.FirstName, e.LastName, e.Channel, e.ButtonLabels));
}
void Self_ScriptQuestion(object sender, ScriptQuestionEventArgs e)
{
+ // Is this object muted
+ if (null != client.Self.MuteList.Find(m => (m.Type == MuteType.Object && m.ID == e.TaskID) // muted object by id
+ || (m.Type == MuteType.ByName && m.Name == e.ObjectName) // object muted by name
+ )) return;
+
instance.MainForm.AddNotification(new ntfPermissions(instance, e.Simulator, e.TaskID, e.ItemID, e.ObjectName, e.ObjectOwnerName, e.Questions));
}
tabs["chat"].Highlight();
}
- private void netcom_ChatReceived(object sender, ChatEventArgs e)
- {
- if (string.IsNullOrEmpty(e.Message)) return;
-
- tabs["chat"].Highlight();
- }
-
void Self_LoadURL(object sender, LoadUrlEventArgs e)
{
+ // Is the object or the owner muted?
+ if (null != client.Self.MuteList.Find(m => (m.Type == MuteType.Object && m.ID == e.ObjectID) // muted object by id
+ || (m.Type == MuteType.ByName && m.Name == e.ObjectName) // object muted by name
+ || (m.Type == MuteType.Resident && m.ID == e.OwnerID) // object's owner muted
+ )) return;
+
instance.MainForm.AddNotification(new ntfLoadURL(instance, e));
}
private void netcom_InstantMessageReceived(object sender, InstantMessageEventArgs e)
{
+ // Messaage from someone we muted?
+ if (null != client.Self.MuteList.Find(me => me.Type == MuteType.Resident && me.ID == e.IM.FromAgentID)) return;
+
switch (e.IM.Dialog)
{
case InstantMessageDialog.SessionSend:
private void HandleIMFromObject(InstantMessageEventArgs e)
{
+ // Is the object or the owner muted?
+ if (null != client.Self.MuteList.Find(m => (m.Type == MuteType.Object && m.ID == e.IM.IMSessionID) // muted object by id
+ || (m.Type == MuteType.ByName && m.Name == e.IM.FromAgentName) // object muted by name
+ || (m.Type == MuteType.Resident && m.ID == e.IM.FromAgentID) // object's owner muted
+ )) return;
+
DisplayNotificationInChat(e.IM.FromAgentName + ": " + e.IM.Message);
}
this.rtbText = new System.Windows.Forms.RichTextBox();
this.btnGoTo = new System.Windows.Forms.Button();
this.btnCancel = new System.Windows.Forms.Button();
+ this.btnMute = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// rtbText
this.rtbText.ScrollBars = System.Windows.Forms.RichTextBoxScrollBars.Vertical;
this.rtbText.Size = new System.Drawing.Size(289, 96);
this.rtbText.TabIndex = 0;
- this.rtbText.Text = "Load web page http://radegast.org/ ?\n\nPlease visit\n\nFrom object: Object, ow" +
- "ner Latif Khalifa?";
+ this.rtbText.Text = "Load web page http://radegast.org/ ?\n\nPlease visit\n\nFrom object: Object, owner La" +
+ "tif Khalifa?";
this.rtbText.LinkClicked += new System.Windows.Forms.LinkClickedEventHandler(this.rtbText_LinkClicked);
//
// btnGoTo
this.btnCancel.UseVisualStyleBackColor = true;
this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
//
+ // btnMute
+ //
+ this.btnMute.Location = new System.Drawing.Point(230, 117);
+ this.btnMute.Name = "btnMute";
+ this.btnMute.Size = new System.Drawing.Size(75, 23);
+ this.btnMute.TabIndex = 3;
+ this.btnMute.Text = "Mute";
+ this.btnMute.UseVisualStyleBackColor = true;
+ this.btnMute.Click += new System.EventHandler(this.btnMute_Click);
+ //
// ntfLoadURL
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.Controls.Add(this.btnMute);
this.Controls.Add(this.btnCancel);
this.Controls.Add(this.btnGoTo);
this.Controls.Add(this.rtbText);
public System.Windows.Forms.RichTextBox rtbText;
public System.Windows.Forms.Button btnGoTo;
public System.Windows.Forms.Button btnCancel;
+ public System.Windows.Forms.Button btnMute;
}
}
rtbText.BackColor = Parent.BackColor;
}
}
+
+ private void btnMute_Click(object sender, EventArgs e)
+ {
+ instance.Client.Self.UpdateMuteListEntry(MuteType.Object, ev.ObjectID, ev.ObjectName);
+ instance.MainForm.RemoveNotification(this);
+ }
}
}
/// </summary>
private void InitializeComponent()
{
- this.btnIgnore = new System.Windows.Forms.Button();
+ this.btnMute = new System.Windows.Forms.Button();
this.btnNo = new System.Windows.Forms.Button();
this.btnYes = new System.Windows.Forms.Button();
this.txtMessage = new System.Windows.Forms.TextBox();
this.SuspendLayout();
//
- // btnIgnore
+ // btnMute
//
- this.btnIgnore.Location = new System.Drawing.Point(165, 62);
- this.btnIgnore.Name = "btnIgnore";
- this.btnIgnore.Size = new System.Drawing.Size(75, 23);
- this.btnIgnore.TabIndex = 8;
- this.btnIgnore.Text = "&Ignore";
- this.btnIgnore.UseVisualStyleBackColor = true;
- this.btnIgnore.Click += new System.EventHandler(this.btnIgnore_Click);
+ this.btnMute.Location = new System.Drawing.Point(165, 62);
+ this.btnMute.Name = "btnMute";
+ this.btnMute.Size = new System.Drawing.Size(75, 23);
+ this.btnMute.TabIndex = 8;
+ this.btnMute.Text = "&Mute";
+ this.btnMute.UseVisualStyleBackColor = true;
+ this.btnMute.Click += new System.EventHandler(this.btnMute_Click);
//
// btnNo
//
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.Controls.Add(this.btnIgnore);
+ this.Controls.Add(this.btnMute);
this.Controls.Add(this.btnNo);
this.Controls.Add(this.btnYes);
this.Controls.Add(this.txtMessage);
#endregion
- public System.Windows.Forms.Button btnIgnore;
+ public System.Windows.Forms.Button btnMute;
public System.Windows.Forms.Button btnNo;
public System.Windows.Forms.Button btnYes;
public System.Windows.Forms.TextBox txtMessage;
args.Text = txtMessage.Text;
args.Buttons.Add(btnYes);
args.Buttons.Add(btnNo);
- args.Buttons.Add(btnIgnore);
+ args.Buttons.Add(btnMute);
FireNotificationCallback(args);
}
instance.MainForm.RemoveNotification(this);
}
- private void btnIgnore_Click(object sender, EventArgs e)
+ private void btnMute_Click(object sender, EventArgs e)
{
+ instance.Client.Self.UpdateMuteListEntry(MuteType.Object, taskID, objectName);
instance.MainForm.RemoveNotification(this);
}
}