Login  Register

Re: (G|S)etting arbitrary properties on user nodes -- is this safe?

Posted by DavidJCobb on Nov 11, 2011; 6:44am
URL: https://support.nabble.com/G-S-etting-arbitrary-properties-on-user-nodes-is-this-safe-tp6979544p6984477.html

Hugo <Nabble> wrote
DavidJCobb wrote
<p>The method by which I do this is fairly simple -- <code><n.some_user_node.set_property name="about_me" value="This is a blurb!"/></code> -- and it seems to work just fine right now. However, this is undocumented functionality, so honestly I have no idea if it's future-compatible. Will this method remain functional and safe to use in the future?</p>
If the idea is to expand the user profile, then you should use the user properties instead of the node properties. So you can call things like this:
n.page_user.has_property name="abc"
n.page_user.set_property name="abc" value="1"
n.page_user.delete_property name="abc"
n.page_user.get_property name="abc"
I know this information is not easily available on our NAML user interface, but we will keep improving it so that users can explore the binary namespaces and learn more about the available commands.
Ah, I actually did set it directly on the users. I just thought that users were also nodes, which is why I said "some user node". Thank you for the clarification.

Hugo <Nabble> wrote
DavidJCobb wrote
how would I go about applying the same HTML processing to these custom properties as that applied to posts? I.e. stripping out SCRIPT tags and the like, while permitting most HTML code? I found process_message_html and the related macros, but I can't get them to work for anything that isn't specifically a message or signature.
This is a very good question. I will discuss this with the Nabble team and try to find a solution. I will get back to you soon.
Thanks. You and Peter's help is very, very much appreciated. :)