OSDN Git Service

RAD-312: Due to SL protocol change, group notices don't show group name or logo
authorLatif Khalifa <latifer@streamgrid.net>
Wed, 26 Oct 2011 14:17:26 +0000 (14:17 +0000)
committerLatif Khalifa <latifer@streamgrid.net>
Wed, 26 Oct 2011 14:17:26 +0000 (14:17 +0000)
git-svn-id: https://radegast.googlecode.com/svn/trunk@1179 f7a694da-4d33-11de-9ad6-1127a62b9fcd

Radegast/GUI/Notifications/GroupNoticeNotification.cs

index 0b4f916..4dfd719 100644 (file)
@@ -66,20 +66,26 @@ namespace Radegast
             }
 
             string group = string.Empty;
-            string text = msg.Message.Replace("\n", System.Environment.NewLine);
-            int pos = msg.Message.IndexOf('|');
-            string title = msg.Message.Substring(0, pos);
-            text = text.Remove(0, pos + 1);
 
-            if (instance.Groups.ContainsKey(msg.FromAgentID))
+            if (msg.BinaryBucket.Length >= 18)
             {
-                group = instance.Groups[msg.FromAgentID].Name;
-                if (instance.Groups[msg.FromAgentID].InsigniaID != UUID.Zero)
+                UUID groupID = new UUID(msg.BinaryBucket, 2);
+
+                if (instance.Groups.ContainsKey(groupID))
                 {
-                    imgGroup.Init(instance, instance.Groups[msg.FromAgentID].InsigniaID, string.Empty);
+                    group = instance.Groups[groupID].Name;
+                    if (instance.Groups[groupID].InsigniaID != UUID.Zero)
+                    {
+                        imgGroup.Init(instance, instance.Groups[groupID].InsigniaID, string.Empty);
+                    }
                 }
             }
 
+            string text = msg.Message.Replace("\n", System.Environment.NewLine);
+            int pos = msg.Message.IndexOf('|');
+            string title = msg.Message.Substring(0, pos);
+            text = text.Remove(0, pos + 1);
+
             lblTitle.Text = title;
             lblSentBy.Text = string.Format("Sent by {0}, {1}", msg.FromAgentName, group);
             txtNotice.Text = text;