private void OnMessageFromObject(InstantMessageEventArgs e) { var msg = new IntermediateMessage(); msg.Sender = mapper.MapObject(e.IM.FromAgentID, e.IM.FromAgentName); msg.Timestamp = e.IM.Timestamp; msg.Type = MessageType.ObjectIM; if (e.IM.Dialog == InstantMessageDialog.BusyAutoResponse) { msg.Type = MessageType.AwayMessage; } msg.Payload = e.IM.Message; localChannel.SendMessageDownstream(msg); }
public void OnLocalChat(object sender, OpenMetaverse.ChatEventArgs e) { if (e.Type == ChatType.StartTyping || e.Type == ChatType.StopTyping || e.Type == ChatType.Debug) { return; } if (e.SourceID == client.Self.AgentID) { return; } System.Diagnostics.Debug.WriteLine("Local chat: <{1}> {0}", e.Message, e.FromName); var msg = new IntermediateMessage(); msg.Payload = e.Message; if (e.SourceType == OpenMetaverse.ChatSourceType.Object) { msg.Sender = mapper.MapObject(e.SourceID, e.FromName); } else if (e.SourceType == OpenMetaverse.ChatSourceType.Agent) { msg.Sender = mapper.MapUser(e.SourceID, e.FromName); } else { msg.Sender = mapper.Grid; } msg.Timestamp = DateTime.UtcNow; if (e.SourceType == ChatSourceType.System) { msg.Type = MessageType.System; msg.Sender = mapper.Grid; } if (e.Type == OpenMetaverse.ChatType.Shout) { msg.Type = MessageType.Shout; } else if (e.Type == ChatType.Whisper) { msg.Type = MessageType.Whisper; } else if (e.Type == ChatType.RegionSay) { msg.Type = MessageType.RegionSay; } else if (e.Type == ChatType.OwnerSay) { msg.Type = MessageType.OwnerSay; if (Rlv(msg.Payload)) { return; } } SendMessageDownstream(msg); }