!!
Hubzilla DevelopmentContinuing my descent down the Addon rabbit hole, I'm seeing that it would be useful for addons to be able to pass and process items that don't fall into the "core" message types (post, wiki, article, webpage, etc.). An example use would be to pass data updates to channel clones for a custom database table.
What I'd like to do is create a definition for ITEM_TYPE_ADDON_CUSTOM in addition to the other item types that are already defined. If an addon used this for message passing, the addon would be responsible for figuring out whether an item is destined for itself or another addon (probably through an iconfig variable unless there is some other mechanism [special data format of the 'body' for example] for determining it).
There would be a check in item_store() to set the "cancel" flag by default for items of this type. Therefore, if an addon is not installed on the hub or for whatever reason does not process the incoming item, it will
not be stored in the item table. If an addon does intercepts it and clears the "cancel" flag, then it could be stored in the item table (thus the reason for not wanting to "dual purpose" one of the existing item types). Another possibility would be to assign two custom types - one that IS saved by default, the other that is not.
A few questions related to this (1) Is there any reason not to proceed in the manner described? (2) is there another/better method that should be considered for passing arbitrary data for addons that would allow them to use ZOT as the MTA to synchronize data? (3) If this is the path to take, should we just assign the next available integer (I think we are using 0-7 currently, so 8 would be next) or should we assign a higher value (eg., 100 or 1000) for this purpose?