HGFriendsModule: add the scaffolding for supporting permissions pertaining to HG friendships. Snoopy take it from here.
parent
78fd487a70
commit
f2ede8c7e0
|
@ -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)
|
||||||
{
|
{
|
||||||
|
|
|
@ -87,6 +87,19 @@ 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)
|
||||||
|
{
|
||||||
|
// TODO: read in all config variables pertaining to
|
||||||
|
// HG friendship permissions
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region IFriendsSimConnector
|
#region IFriendsSimConnector
|
||||||
|
@ -105,6 +118,23 @@ 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);
|
||||||
|
|
||||||
|
// TODO: CHECK IF friendID is foreigner and if principalID has the permission
|
||||||
|
// to request these kinds of friendships. If not, return immediately.
|
||||||
|
// Maybe you want to let the client know too with
|
||||||
|
// client.SendAlertMessage
|
||||||
|
}
|
||||||
|
|
||||||
|
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
|
||||||
|
|
Loading…
Reference in New Issue