aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorDiva Canto2012-04-11 08:11:05 -0700
committerDiva Canto2012-04-11 08:13:11 -0700
commitf2ede8c7e09487436261b249ec093bfd01c3f971 (patch)
tree2058eed5416f83fe94133c648fb57dbc448243b4 /OpenSim
parentNew OS scripting functions osSetTerrainTexture and osSetTerrainHeight as orig... (diff)
downloadopensim-SC_OLD-f2ede8c7e09487436261b249ec093bfd01c3f971.zip
opensim-SC_OLD-f2ede8c7e09487436261b249ec093bfd01c3f971.tar.gz
opensim-SC_OLD-f2ede8c7e09487436261b249ec093bfd01c3f971.tar.bz2
opensim-SC_OLD-f2ede8c7e09487436261b249ec093bfd01c3f971.tar.xz
HGFriendsModule: add the scaffolding for supporting permissions pertaining to HG friendships. Snoopy take it from here.
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs4
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs30
2 files changed, 32 insertions, 2 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs
index f64c161..fc6325d 100644
--- a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs
@@ -162,7 +162,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
162 } 162 }
163 } 163 }
164 164
165 protected void InitModule(IConfigSource config) 165 protected virtual void InitModule(IConfigSource config)
166 { 166 {
167 IConfig friendsConfig = config.Configs["Friends"]; 167 IConfig friendsConfig = config.Configs["Friends"];
168 if (friendsConfig != null) 168 if (friendsConfig != null)
@@ -546,7 +546,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
546 } 546 }
547 } 547 }
548 548
549 private void OnInstantMessage(IClientAPI client, GridInstantMessage im) 549 protected virtual void OnInstantMessage(IClientAPI client, GridInstantMessage im)
550 { 550 {
551 if ((InstantMessageDialog)im.dialog == InstantMessageDialog.FriendshipOffered) 551 if ((InstantMessageDialog)im.dialog == InstantMessageDialog.FriendshipOffered)
552 { 552 {
diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs
index 9a6d277..ddb6a71 100644
--- a/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs
@@ -87,6 +87,19 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
87 m_StatusNotifier = new HGStatusNotifier(this); 87 m_StatusNotifier = new HGStatusNotifier(this);
88 } 88 }
89 89
90 protected override void InitModule(IConfigSource config)
91 {
92 base.InitModule(config);
93
94 // Additionally to the base method
95 IConfig friendsConfig = config.Configs["HGFriendsModule"];
96 if (friendsConfig != null)
97 {
98 // TODO: read in all config variables pertaining to
99 // HG friendship permissions
100 }
101 }
102
90 #endregion 103 #endregion
91 104
92 #region IFriendsSimConnector 105 #region IFriendsSimConnector
@@ -105,6 +118,23 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
105 118
106 #endregion 119 #endregion
107 120
121 protected override void OnInstantMessage(IClientAPI client, GridInstantMessage im)
122 {
123 if ((InstantMessageDialog)im.dialog == InstantMessageDialog.FriendshipOffered)
124 {
125 // we got a friendship offer
126 UUID principalID = new UUID(im.fromAgentID);
127 UUID friendID = new UUID(im.toAgentID);
128
129 // TODO: CHECK IF friendID is foreigner and if principalID has the permission
130 // to request these kinds of friendships. If not, return immediately.
131 // Maybe you want to let the client know too with
132 // client.SendAlertMessage
133 }
134
135 base.OnInstantMessage(client, im);
136 }
137
108 protected override void OnApproveFriendRequest(IClientAPI client, UUID friendID, List<UUID> callingCardFolders) 138 protected override void OnApproveFriendRequest(IClientAPI client, UUID friendID, List<UUID> callingCardFolders)
109 { 139 {
110 // Update the local cache. Yes, we need to do it right here 140 // Update the local cache. Yes, we need to do it right here