4 - GatherMate_Sharing's use of AddNode makes it hard for other addons to distinguish self harvested nodes
What is the enhancement in mind? How should it look and feel?
revert change r58.
GatherMate_Sharing should use InjectNode and DeleteNode instead of AddNode and RemoveNodeByID. Otherwise it confuses node origin for other possible addons.
Please provide any additional information below.
r58 changed the way that GatherMate_Sharing adds nodes to GatherMate. This was done to allow GatherMate to fire an event when a node is received from someone else. However, because the GatherMate message infrastructure does not allow specifying node origin (even if it would not use it internally), this makes it rather hard to distinguish between nodes that are gathered by the user and those shared by someone else.
This is not really a problem if the only addons listening for these messages are GatherMate and GatherMate_Sharing, but it does make it hard to implement additional sharing addons for GatherMate (See GatherTogether on curseforge, WIP).
Unless GatherMate provides a means to indicate node origin, can this change be reverted?
(I would also argue that searching for the zone name each and every time through this function is inefficient)
| User | When | Change |
|---|---|---|
| LokiCoyote | Mon, 08 Dec 2008 22:44:01 | Create |
- 4 comments
- 4 comments
Facts
- Reported on
- 08 Dec 2008
- Status
- New - Issue has not had initial review yet.
- Type
- Enhancement - A change which is intended to better the project in some way
- Priority
- Medium - Normal priority.
- #4
LokiCoyote Sat, 20 Dec 2008 02:47:06Ok, it would seem that routes needs the message to ensure that it gets notified of the new node. Using InjectNode and DeleteNode bypass any message broadcasting and notification.
Yes, GatherMate_Sharing does prevent itself from creating an infinite loop.
However, it might be useful for other addons (that don't want GatherMate_Sharing's updates) to gain some access to the actingoncomm variable. Otherwise, hooking the OnMessage is probably the only way to avoid the GatherMate NodeAdded / Deleted message.
Another possibility, that would require updating Routes, etc. Would be for GatherMate_Sharing to send its own message.
A further possibility would be for GatherMate to accept a source (ie, the sender in the comm message or nil if the user gathers the node) in the AddNode / RemoveNodeXXX functions and then pass it along in the SendMessages. An addon that is interested in user gathered nodes could discard messages with non-nil sources. An addon interested in all nodes would get them all. Inject would still be useful for database bulk updates.
This might be more an issue for GatherMate to solve.
- #3
kagaro Fri, 19 Dec 2008 16:34:35plese go take a look at routes to see how it handles the messages
- #2
kagaro Fri, 19 Dec 2008 16:32:54It also checks a actingoncomm varialbe to know it just got the node via a message
- #1
kagaro Fri, 19 Dec 2008 16:32:08it was switched for routes to properly function