I am developing a custom module, which should do things in hook_nodeapi() only if the node is being created/edited via Services. I couldn't find any data that is available at this point for deciding if the node is via Services or not.
I am aware of a possible solution, using
request_uri() and deciding based on that (https://drupal.stackexchange.com/a/8568/1930), but it seems so wrong. Hardcoding the endpoint name is plain wrong. Workaround this by providing an admin interface and depend on configuration?
So, I would rather avoid the above, but couldn't come up with anything else so far. I am curious if others have had similar problems before and if there is a better solution.
The accepted answer should be used, as that is the cleanest solution. Unfortunately, I had to use a different one, which might still be useful to others so I am sharing it here: https://gist.github.com/Temaruk/5884209