Issue Details (XML | Word | Printable)

Type: Sub-task Sub-task
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: OlofTjerngren
Reporter: cygnusecks1
Votes: 0
Watchers: 0

If you were logged in you would be able to see more operations.

Generate activity:context objects for group activity

Created: 27/Oct/09 05:01 AM   Updated: 27/Nov/09 12:36 PM   Resolved: 27/Nov/09 12:36 PM
Component/s: CEQ Plugin for
Affects Version/s: Milestone 1.2
Fix Version/s: Milestone 1.3

Time Tracking:
Not Specified



Issue Links:


 Description  « Hide

Currently when a user joins a StatusNet group, a join activity is generated using the group's "vanity" name, plus an auto-generated ID. Later on, when activity occurs within this group (e.g. a post with !groupname), a tag is created using the atom:content element using the group's short-name. There is no way to associate this tag with the original created group, as the group id and group name are not the same as the group's "short-name".

To resolve this, I believe the proper way to associate activity within the context of a group is to use the activity:context object container. This allows the same group definition used in join/leave activities to be used with posts or other activities. For example, if a user posts something like "this message is for the !developers group", then instead of tagging the post with "developers", you should generate an activity:context object that looks like this:

		<title>this message is really in !developers</title>
		<link rel="alternate"
				<title>CEQ Developers</title>
		<content type="html">this message is really in !&lt;span class=&quot;vcard&quot;&gt;&lt;a
			class=&quot;url&quot; title=&quot;CEQ Developers (developers)&quot;&gt;&lt;span
			class=&quot;fn nickname&quot;&gt;developers&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;</content>
			<content>whoops this message is really in !developers</content>
			<link rel="permalink" type="text/html"

This way, code that processes this stream can correlate activity within the context of the group. Note that the <activity:object> elements that are contained within the <activity:context> element are identical to the <activity:object> that is used in all other activities within the group, including joins and leaves.

Also, note that you can have multiple groups defined within the context object:

				<title>CEQ Developers</title>
				<title>Some Other Group Name</title>

cygnusecks1 added a comment - 27/Oct/09 05:04 AM

BTW, <activity:context> has already been defined as a generic container in the activitystreams spec. I did not make it up Its description sounds exactly like what we need:

The activity:context element is a container for additional contextual information about an activity. This information will often be orthogonal to the verb and object type and supply additional information about the situation in which the activity was performed. For example, an activity entry could contain information about the actor's location at the time of the activity.

OlofTjerngren added a comment - 27/Oct/09 11:51 AM

It does sound like a good match, added and live.

It's duplicated in the <category> tag because Statusnet will auto-add a tag with the short group name whenever one is used.

<category> is used in the Atom feed for tags, should I remove that and use the activitystreams tag object instead?

Or keep <category> and add the AS tag object in addition.

PRE added a comment - 27/Nov/09 12:36 PM

implemented via activitystreams extension