aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs
diff options
context:
space:
mode:
authorTom Grimshaw2010-07-04 06:51:01 -0700
committerTom Grimshaw2010-07-04 06:51:01 -0700
commit14ab22dcd43740e1ece2840a1b10dea155b55ebe (patch)
tree7a58bca4a2e584b383d1d95942267f2393f1f06c /OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs
parentCheck cached asset to make sure it contains data, and if not, re-request (diff)
parentMerge branch 'master' into careminster-presence-refactor (diff)
downloadopensim-SC-14ab22dcd43740e1ece2840a1b10dea155b55ebe.zip
opensim-SC-14ab22dcd43740e1ece2840a1b10dea155b55ebe.tar.gz
opensim-SC-14ab22dcd43740e1ece2840a1b10dea155b55ebe.tar.bz2
opensim-SC-14ab22dcd43740e1ece2840a1b10dea155b55ebe.tar.xz
Merge branch 'careminster-presence-refactor' of ssh://3dhosting.de/var/git/careminster into careminster-presence-refactor
Diffstat (limited to 'OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs')
-rw-r--r--OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs27
1 files changed, 21 insertions, 6 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs
index a7aa4ea..ffdac58 100644
--- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs
@@ -156,16 +156,31 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
156 return; 156 return;
157 } 157 }
158 158
159 // Force timestamp to server time to avoid "Saved on" headers 159 DateTime dt = DateTime.UtcNow;
160 // being generated for online users
161 im.timestamp = (uint)Util.UnixTimeSinceEpoch();
162 160
163 if (dialog == (byte)InstantMessageDialog.MessageFromAgent || 161 // Ticks from UtcNow, but make it look like local. Evil, huh?
164 dialog == (byte)InstantMessageDialog.MessageFromObject) 162 dt = DateTime.SpecifyKind(dt, DateTimeKind.Local);
163
164 try
165 {
166 // Convert that to the PST timezone
167 TimeZoneInfo timeZoneInfo = TimeZoneInfo.FindSystemTimeZoneById("America/Los_Angeles");
168 dt = TimeZoneInfo.ConvertTime(dt, timeZoneInfo);
169 }
170 catch
165 { 171 {
166 im.offline = 1; 172 m_log.Info("[OFFLINE MESSAGING]: No PST timezone found on this machine. Saving with local timestamp.");
167 } 173 }
168 174
175 // And make it look local again to fool the unix time util
176 dt = DateTime.SpecifyKind(dt, DateTimeKind.Utc);
177
178 im.timestamp = (uint)Util.ToUnixTime(dt);
179
180 // If client is null, this message comes from storage and IS offline
181 if (client != null)
182 im.offline = 0;
183
169 if (m_TransferModule != null) 184 if (m_TransferModule != null)
170 { 185 {
171 m_TransferModule.SendInstantMessage(im, 186 m_TransferModule.SendInstantMessage(im,