Receiving the online status of a user

8 views
Skip to first unread message

Nick Jennings

unread,
Apr 10, 2013, 8:36:02 AM4/10/13
to activity...@googlegroups.com
Hi all,

 I am in the process of implementing a set of XMPP actions using AS as the protocol. I'm using the friend request set of verbs to add/remove people from your roster (request, remove, make-friend), and send (obviously) for sending/receiving messages.

 However I'm at a loss to find something appropriate for things like buddy state notifications. Both initial state (when signing in) and changed state. The types of state from XMPP are ONLINE, OFFLINE, DND, AWAY. However there's no real verb to describe that a user is publishing their state notification.

There are two ways I was thinking about it. Either 4 different verbs that can match up with each possible state, or - perhaps a better approach - to find one verb which implies a state change for the user, with the content of that change contained in the obejct.

Does anyone have any ideas as to what verb would fit in this case?

Cheers
Nick

James M Snell

unread,
Apr 17, 2013, 11:52:34 AM4/17/13
to activity...@googlegroups.com
Hey Nick, My apologies, your original note was stuck in the moderation
queue. I just pushed it through...

There are a couple of ways to look at this issue... (a) you can view
the status updates as verbs themselves, or (b) you can view the status
as an object.

For (a), you can do as you suggest: "actor" = the person, "verb" =
"available|unavailable" .. etc...

{
"actor": {...},
"verb": "online"
}

For (b), you can use the "update" verb with an object that describes
the status...

{
"actor": { ... },
"verb": "update",
"object": {
"objectType": "status",
"status": "online"
}
}

There are valid arguments for either approach, the best thing is to
just pick the one that works best for your case. Personally, I'd go
with option (b) because it provides a great deal more flexibility...
such as placing additional metadata in the status object..

- James
> --
> You received this message because you are subscribed to the Google Groups
> "Activity Streams" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to activity-strea...@googlegroups.com.
> To post to this group, send email to activity...@googlegroups.com.
> Visit this group at http://groups.google.com/group/activity-streams?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Peter Saint-Andre

unread,
Apr 17, 2013, 11:54:07 AM4/17/13
to activity...@googlegroups.com, James M Snell
On 4/17/13 9:52 AM, James M Snell wrote:
> Hey Nick, My apologies, your original note was stuck in the moderation
> queue. I just pushed it through...
>
> There are a couple of ways to look at this issue... (a) you can view
> the status updates as verbs themselves, or (b) you can view the status
> as an object.
>
> For (a), you can do as you suggest: "actor" = the person, "verb" =
> "available|unavailable" .. etc...
>
> {
> "actor": {...},
> "verb": "online"
> }
>
> For (b), you can use the "update" verb with an object that describes
> the status...
>
> {
> "actor": { ... },
> "verb": "update",
> "object": {
> "objectType": "status",
> "status": "online"
> }
> }
>
> There are valid arguments for either approach, the best thing is to
> just pick the one that works best for your case. Personally, I'd go
> with option (b) because it provides a great deal more flexibility...
> such as placing additional metadata in the status object..
>
That seems sensible, since in XMPP we have data other than boolean
available/unavailable.

Peter

Reply all
Reply to author
Forward
0 new messages