Merge branch 'master' of /home/opensim/var/repo/opensim
commit
e0c4f8ed76
|
@ -162,7 +162,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void InitModule(IConfigSource config)
|
protected virtual void InitModule(IConfigSource config)
|
||||||
{
|
{
|
||||||
IConfig friendsConfig = config.Configs["Friends"];
|
IConfig friendsConfig = config.Configs["Friends"];
|
||||||
if (friendsConfig != null)
|
if (friendsConfig != null)
|
||||||
|
@ -546,7 +546,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnInstantMessage(IClientAPI client, GridInstantMessage im)
|
protected virtual void OnInstantMessage(IClientAPI client, GridInstantMessage im)
|
||||||
{
|
{
|
||||||
if ((InstantMessageDialog)im.dialog == InstantMessageDialog.FriendshipOffered)
|
if ((InstantMessageDialog)im.dialog == InstantMessageDialog.FriendshipOffered)
|
||||||
{
|
{
|
||||||
|
|
|
@ -50,6 +50,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
|
||||||
{
|
{
|
||||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
|
|
||||||
|
private int m_levelHGFriends = 0;
|
||||||
|
|
||||||
IUserManagement m_uMan;
|
IUserManagement m_uMan;
|
||||||
public IUserManagement UserManagementModule
|
public IUserManagement UserManagementModule
|
||||||
{
|
{
|
||||||
|
@ -87,6 +89,21 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
|
||||||
m_StatusNotifier = new HGStatusNotifier(this);
|
m_StatusNotifier = new HGStatusNotifier(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override void InitModule(IConfigSource config)
|
||||||
|
{
|
||||||
|
base.InitModule(config);
|
||||||
|
|
||||||
|
// Additionally to the base method
|
||||||
|
IConfig friendsConfig = config.Configs["HGFriendsModule"];
|
||||||
|
if (friendsConfig != null)
|
||||||
|
{
|
||||||
|
m_levelHGFriends = friendsConfig.GetInt("LevelHGFriends", 0);
|
||||||
|
|
||||||
|
// TODO: read in all config variables pertaining to
|
||||||
|
// HG friendship permissions
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region IFriendsSimConnector
|
#region IFriendsSimConnector
|
||||||
|
@ -105,6 +122,35 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
protected override void OnInstantMessage(IClientAPI client, GridInstantMessage im)
|
||||||
|
{
|
||||||
|
if ((InstantMessageDialog)im.dialog == InstantMessageDialog.FriendshipOffered)
|
||||||
|
{
|
||||||
|
// we got a friendship offer
|
||||||
|
UUID principalID = new UUID(im.fromAgentID);
|
||||||
|
UUID friendID = new UUID(im.toAgentID);
|
||||||
|
|
||||||
|
// Check if friendID is foreigner and if principalID has the permission
|
||||||
|
// to request friendships with foreigners. If not, return immediately.
|
||||||
|
if (!UserManagementModule.IsLocalGridUser(friendID))
|
||||||
|
{
|
||||||
|
ScenePresence avatar = null;
|
||||||
|
((Scene)client.Scene).TryGetScenePresence(principalID, out avatar);
|
||||||
|
|
||||||
|
if (avatar == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (avatar.UserLevel < m_levelHGFriends)
|
||||||
|
{
|
||||||
|
client.SendAgentAlertMessage("Unable to send friendship invitation to foreigner. Insufficient permissions.", false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
base.OnInstantMessage(client, im);
|
||||||
|
}
|
||||||
|
|
||||||
protected override void OnApproveFriendRequest(IClientAPI client, UUID friendID, List<UUID> callingCardFolders)
|
protected override void OnApproveFriendRequest(IClientAPI client, UUID friendID, List<UUID> callingCardFolders)
|
||||||
{
|
{
|
||||||
// Update the local cache. Yes, we need to do it right here
|
// Update the local cache. Yes, we need to do it right here
|
||||||
|
|
|
@ -137,6 +137,10 @@
|
||||||
;; uncomment the next line. You may want to do this on sims that have licensed content.
|
;; uncomment the next line. You may want to do this on sims that have licensed content.
|
||||||
; OutboundPermission = False
|
; OutboundPermission = False
|
||||||
|
|
||||||
|
[HGFriendsModule]
|
||||||
|
; User level required to be able to send friendship invitations to foreign users
|
||||||
|
;LevelHGFriends = 0;
|
||||||
|
|
||||||
[UserAgentService]
|
[UserAgentService]
|
||||||
;
|
;
|
||||||
; === HG ONLY ===
|
; === HG ONLY ===
|
||||||
|
|
|
@ -61,6 +61,10 @@
|
||||||
;; uncomment the next line. You may want to do this on sims that have licensed content.
|
;; uncomment the next line. You may want to do this on sims that have licensed content.
|
||||||
; OutboundPermission = False
|
; OutboundPermission = False
|
||||||
|
|
||||||
|
[HGFriendsModule]
|
||||||
|
; User level required to be able to send friendship invitations to foreign users
|
||||||
|
;LevelHGFriends = 0;
|
||||||
|
|
||||||
[GridService]
|
[GridService]
|
||||||
;; For in-memory region storage (default)
|
;; For in-memory region storage (default)
|
||||||
StorageProvider = "OpenSim.Data.Null.dll:NullRegionData"
|
StorageProvider = "OpenSim.Data.Null.dll:NullRegionData"
|
||||||
|
|
Loading…
Reference in New Issue