aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Modules/ChatModule.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Environment/Modules/ChatModule.cs')
-rw-r--r--OpenSim/Region/Environment/Modules/ChatModule.cs61
1 files changed, 15 insertions, 46 deletions
diff --git a/OpenSim/Region/Environment/Modules/ChatModule.cs b/OpenSim/Region/Environment/Modules/ChatModule.cs
index 081e7ac..75d3670 100644
--- a/OpenSim/Region/Environment/Modules/ChatModule.cs
+++ b/OpenSim/Region/Environment/Modules/ChatModule.cs
@@ -119,31 +119,15 @@ namespace OpenSim.Region.Environment.Modules
119 LLVector3 toRegionPos = presence.AbsolutePosition + regionPos; 119 LLVector3 toRegionPos = presence.AbsolutePosition + regionPos;
120 int dis = Math.Abs((int) Util.GetDistanceTo(toRegionPos, fromRegionPos)); 120 int dis = Math.Abs((int) Util.GetDistanceTo(toRegionPos, fromRegionPos));
121 121
122 switch (type) 122 if (type == ChatTypeEnum.Whisper && dis > m_whisperdistance ||
123 type == ChatTypeEnum.Say && dis > m_saydistance ||
124 type == ChatTypeEnum.Shout && dis > m_shoutdistance)
123 { 125 {
124 case ChatTypeEnum.Whisper: 126 return;
125 if (dis < m_whisperdistance)
126 {
127 // TODO: should change so the message is sent through the avatar rather than direct to the ClientView
128 presence.ControllingClient.SendChatMessage(message, (byte) type, fromPos, fromName, fromAgentID);
129 }
130 break;
131 case ChatTypeEnum.Say:
132 if (dis < m_saydistance)
133 {
134 presence.ControllingClient.SendChatMessage(message, (byte) type, fromPos, fromName, fromAgentID);
135 }
136 break;
137 case ChatTypeEnum.Shout:
138 if (dis < m_shoutdistance)
139 {
140 presence.ControllingClient.SendChatMessage(message, (byte) type, fromPos, fromName, fromAgentID);
141 }
142 break;
143 case ChatTypeEnum.Broadcast:
144 presence.ControllingClient.SendChatMessage(message, (byte) type, fromPos, fromName, fromAgentID);
145 break;
146 } 127 }
128
129 // TODO: should change so the message is sent through the avatar rather than direct to the ClientView
130 presence.ControllingClient.SendChatMessage(message, (byte) type, fromPos, fromName, fromAgentID);
147 } 131 }
148 } 132 }
149 133
@@ -185,32 +169,17 @@ namespace OpenSim.Region.Environment.Modules
185 { 169 {
186 m_irc.PrivMsg(fromName, scene.RegionInfo.RegionName, e.Message); 170 m_irc.PrivMsg(fromName, scene.RegionInfo.RegionName, e.Message);
187 } 171 }
188
189 if (e.Channel == 0)
190 {
191 foreach (Scene s in m_scenes)
192 {
193 s.ForEachScenePresence(delegate(ScenePresence presence)
194 {
195 TrySendChatMessage(presence, fromPos, regionPos,
196 fromAgentID, fromName, e.Type, message);
197 });
198 }
199 }
200 } 172 }
201 else 173
174 if (e.Channel == 0)
202 { 175 {
203 if (avatar != null) 176 foreach (Scene s in m_scenes)
204 { 177 {
205 switch (e.Type) 178 s.ForEachScenePresence(delegate(ScenePresence presence)
206 { 179 {
207 case ChatTypeEnum.StartTyping: 180 TrySendChatMessage(presence, fromPos, regionPos,
208 avatar.setTyping(true); 181 fromAgentID, fromName, e.Type, message);
209 break; 182 });
210 case ChatTypeEnum.StopTyping:
211 avatar.setTyping(false);
212 break;
213 }
214 } 183 }
215 } 184 }
216 } 185 }