January 21st, 2006

Allowmask problem

I am using XML-RPC postevent and want to post to either all friends or a specific custom friends group.

Having read the postevent docs

[scalar](required) Specifies who can read this post. Valid values are public (default), private and usemask. When value is usemask, viewability is controlled by the allowmask.

[scalar](required) Relevant when security is usemask. A 32-bit unsigned integer representing which of the user's groups of friends are allowed to view this post. Turn bit 0 on to allow any defined friend to read it. Otherwise, turn bit 1-30 on for every friend group that should be allowed to read it. Bit 31 is reserved.

I assumed I just had to send 0 for all friends and 1 for the first friend group, 2 for the second friend group and so on. But I am clearly misunderstanding the allowmask.

If I send


LJ shows the post with the security set to 'custom' but no specified groups (so in fact no-one but me can see it).

While if I send


LJ shows the post with security set to friends only, not just group 1.

Can anyone explain what I should be doing?

Greasemonkey script: Warn when posting anonymously

Every day, it seems somebody accidentally posts anonymously and quickly follows up with a "That was me" logged-in post. This GreaseMonkey script pops up a 'confirm' dialog and asks you to click 'OK' to continue posting anonymously. It works by adding an event listener to the 'click' event on the submit button. When you click the 'Post Comment' submit button, the event handler looks for the session cookie and a username inside the session cookie. If it finds the cookie and a username, no problem. If not, the dialog pops up to confirm.

Look it over and see if I've missed anything important. If all is well, I'll formally submit it to UserScripts.org.

LJ Anonymous Comment Warning

Of course, you'll need FireFox and the Greasemonkey extension.