Issue Details (XML | Word | Printable)

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

If you were logged in you would be able to see more operations.
community-equity
COMMUNITY_EQUITY-274

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 laconi.ca
Affects Version/s: Milestone 1.2
Fix Version/s: Milestone 1.3

Time Tracking:
Not Specified

Environment:

All

Issue Links:
Related
 

Tags:


 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:

<entry>
		<title>this message is really in !developers</title>
		<id>tag:community-equity.org:81,2009-10-10:/5/notice/83/238</id>
		<link rel="alternate"
		      href="http://community-equity.org:81/mb/index.php/notice/83"/>
		<published>2009-10-27T02:22:28+00:00</published>
		<updated>2009-10-27T02:22:28+00:00</updated>
		<author>
			<name>cygnusecks1</name>
			<uri>http://community-equity.org:81/mb/index.php/cygnusecks1</uri>
			<email>syrinx@cfl.rr.com</email>
		</author>
		<activity:verb>http://activitystrea.ms/schema/1.0/post</activity:verb>
		<activity:context>
			<activity:object>
				<activity:object-type>http://activitystrea.ms/schema/1.0/group</activity:object-type>
				<id>http://community-equity.org:81/mb/index.php/group/1/id</id>
				<title>CEQ Developers</title>
			</activity:object>
		</activity:context>
		<content type="html">this message is really in !&lt;span class=&quot;vcard&quot;&gt;&lt;a
			href=&quot;http://community-equity.org:81/mb/index.php/group/1/id&quot;
			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>
		<activity:object>
			<activity:object-type>http://activitystrea.ms/schema/1.0/note
			</activity:object-type>
			<content>whoops this message is really in !developers</content>
			<published>2009-10-27T02:22:28+00:00</published>
			<link rel="permalink" type="text/html"
			      href="http://community-equity.org:81/mb/index.php/notice/83"/>
		</activity:object>
	</entry>

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:

<activity:context>
			<activity:object>
				<activity:object-type>http://activitystrea.ms/schema/1.0/group</activity:object-type>
				<id>http://community-equity.org:81/mb/index.php/group/1/id</id>
				<title>CEQ Developers</title>
			</activity:object>
			<activity:object>
				<activity:object-type>http://activitystrea.ms/schema/1.0/group</activity:object-type>
				<id>http://community-equity.org:81/mb/index.php/group/13/id</id>
				<title>Some Other Group Name</title>
			</activity:object>
		</activity:context>


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 status.net activitystreams extension