From 38503096d905fbb4db8552eeb59afc12d4b5e903 Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Wed, 3 Mar 2010 23:34:48 -0500 Subject: [PATCH 1/7] Puts All groups and Remote sub button in the mini list on the same line --- plugins/OStatus/theme/base/css/ostatus.css | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/OStatus/theme/base/css/ostatus.css b/plugins/OStatus/theme/base/css/ostatus.css index ac668623d8..f7d9853cf7 100644 --- a/plugins/OStatus/theme/base/css/ostatus.css +++ b/plugins/OStatus/theme/base/css/ostatus.css @@ -52,7 +52,8 @@ margin-bottom:0; width:405px; } -.aside #entity_subscriptions .more { +.aside #entity_subscriptions .more, +.aside #entity_groups .more { float:left; } From b97ac60209fdec3f2d521f7c9d54acca6d00d274 Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Wed, 3 Mar 2010 23:47:27 -0500 Subject: [PATCH 2/7] Changed text for authorizing/confirming remote profile --- plugins/OStatus/actions/ostatussub.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/OStatus/actions/ostatussub.php b/plugins/OStatus/actions/ostatussub.php index bee48a8aed..65dee2392f 100644 --- a/plugins/OStatus/actions/ostatussub.php +++ b/plugins/OStatus/actions/ostatussub.php @@ -398,7 +398,7 @@ class OStatusSubAction extends Action function title() { // TRANS: Page title for OStatus remote subscription form - return _m('Authorize subscription'); + return _m('Confirm'); } /** From f210cadfecc4f87e1fb8e35cd784a7010c443c31 Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Wed, 3 Mar 2010 17:35:18 -0800 Subject: [PATCH 3/7] Revert "Revert "Show and no activity actors for user feed"" This reverts commit e2578cfad68c45ca177c51997c4cc7c0abafbd9a. --- classes/Notice.php | 8 +++++--- lib/atomnoticefeed.php | 16 +++++++++++++--- lib/atomusernoticefeed.php | 11 +++++++++++ 3 files changed, 29 insertions(+), 6 deletions(-) diff --git a/classes/Notice.php b/classes/Notice.php index 97cb3b8fbe..4c7e6ab4b7 100644 --- a/classes/Notice.php +++ b/classes/Notice.php @@ -1106,7 +1106,7 @@ class Notice extends Memcached_DataObject return $groups; } - function asAtomEntry($namespace=false, $source=false) + function asAtomEntry($namespace=false, $source=false, $author=true) { $profile = $this->getProfile(); @@ -1151,8 +1151,10 @@ class Notice extends Memcached_DataObject $xs->element('title', null, $this->content); - $xs->raw($profile->asAtomAuthor()); - $xs->raw($profile->asActivityActor()); + if ($author) { + $xs->raw($profile->asAtomAuthor()); + $xs->raw($profile->asActivityActor()); + } $xs->element('link', array('rel' => 'alternate', 'type' => 'text/html', diff --git a/lib/atomnoticefeed.php b/lib/atomnoticefeed.php index 3c3556cb95..e4df731fe0 100644 --- a/lib/atomnoticefeed.php +++ b/lib/atomnoticefeed.php @@ -107,9 +107,19 @@ class AtomNoticeFeed extends Atom10Feed */ function addEntryFromNotice($notice) { - $this->addEntryRaw($notice->asAtomEntry()); + $source = $this->showSource(); + $author = $this->showAuthor(); + + $this->addEntryRaw($notice->asAtomEntry(false, $source, $author)); } + function showSource() + { + return true; + } + + function showAuthor() + { + return true; + } } - - diff --git a/lib/atomusernoticefeed.php b/lib/atomusernoticefeed.php index 55cebef6df..428cc2de2f 100644 --- a/lib/atomusernoticefeed.php +++ b/lib/atomusernoticefeed.php @@ -61,6 +61,7 @@ class AtomUserNoticeFeed extends AtomNoticeFeed if (!empty($user)) { $profile = $user->getProfile(); $this->addAuthor($profile->nickname, $user->uri); + $this->setActivitySubject($profile->asActivityNoun('subject')); } $title = sprintf(_("%s timeline"), $user->nickname); @@ -105,4 +106,14 @@ class AtomUserNoticeFeed extends AtomNoticeFeed { return $this->user; } + + function showSource() + { + return false; + } + + function showAuthor() + { + return false; + } } From 0e360ad23da4404c47bdb074a1afdb2eed873ecd Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Wed, 3 Mar 2010 20:07:13 -0800 Subject: [PATCH 4/7] Test a small user feed to ensure we're taking the activity actor from the subject --- tests/UserFeedParseTest.php | 131 ++++++++++++++++++++++++++++++++++++ 1 file changed, 131 insertions(+) create mode 100644 tests/UserFeedParseTest.php diff --git a/tests/UserFeedParseTest.php b/tests/UserFeedParseTest.php new file mode 100644 index 0000000000..b3f9a64171 --- /dev/null +++ b/tests/UserFeedParseTest.php @@ -0,0 +1,131 @@ +assertFalse(empty($dom)); + + $entries = $dom->getElementsByTagName('entry'); + + $entry1 = $entries->item(0); + $this->assertFalse(empty($entry1)); + + $feedEl = $dom->getElementsByTagName('feed')->item(0); + $this->assertFalse(empty($feedEl)); + + // Test actor (from activity:subject) + + $act1 = new Activity($entry1, $feedEl); + $this->assertFalse(empty($act1)); + $this->assertFalse(empty($act1->actor)); + $this->assertEquals($act1->actor->type, ActivityObject::PERSON); + $this->assertEquals($act1->actor->title, 'Zach Copley'); + $this->assertEquals($act1->actor->id, 'http://localhost/statusnet/user/1'); + $this->assertEquals($act1->actor->link, 'http://localhost/statusnet/zach'); + + $avatars = $act1->actor->avatarLinks; + + $this->assertEquals( + $avatars[0]->url, + 'http://localhost/statusnet/theme/default/default-avatar-profile.png' + ); + + $this->assertEquals( + $avatars[1]->url, + 'http://localhost/statusnet/theme/default/default-avatar-stream.png' + ); + + $this->assertEquals( + $avatars[2]->url, + 'http://localhost/statusnet/theme/default/default-avatar-mini.png' + ); + + $this->assertEquals($act1->actor->displayName, 'Zach Copley'); + + $poco = $act1->actor->poco; + $this->assertEquals($poco->preferredUsername, 'zach'); + $this->assertEquals($poco->address->formatted, 'El Cerrito, CA'); + $this->assertEquals($poco->urls[0]->type, 'homepage'); + $this->assertEquals($poco->urls[0]->value, 'http://zach.copley.name'); + $this->assertEquals($poco->urls[0]->primary, 'true'); + $this->assertEquals($poco->note, 'Zach Hack Attack'); + + // test the post + + //var_export($act1); + $this->assertEquals($act1->object->type, 'http://activitystrea.ms/schema/1.0/note'); + $this->assertEquals($act1->object->title, 'And now for something completely insane...'); + + $this->assertEquals($act1->object->content, 'And now for something completely insane...'); + $this->assertEquals($act1->object->id, 'http://localhost/statusnet/notice/3'); + + } + +} + +$_testfeed1 = << + + http://localhost/statusnet/api/statuses/user_timeline/1.atom + zach timeline + Updates from zach on Zach Dev! + http://localhost/statusnet/theme/default/default-avatar-profile.png + 2010-03-04T01:41:14+00:00 + + zach + http://localhost/statusnet/user/1 + + + + + + + + + + http://activitystrea.ms/schema/1.0/person + http://localhost/statusnet/user/1 + Zach Copley + + + + + +zach +Zach Copley +Zach Hack Attack + + El Cerrito, CA + + + homepage + http://zach.copley.name + true + + + + + And now for something completely insane... + + http://localhost/statusnet/notice/3 + 2010-03-04T01:41:07+00:00 + 2010-03-04T01:41:07+00:00 + + And now for something completely insane... + + + +TESTFEED1; From 8ffb34a90c78502843aabaac71963d2f40c505d8 Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Wed, 3 Mar 2010 20:55:53 -0800 Subject: [PATCH 5/7] Temp fix for problem getting actor from PuSH updates where actor is only specified in subject --- lib/activity.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/activity.php b/lib/activity.php index ce14fa2546..e1bce6f190 100644 --- a/lib/activity.php +++ b/lib/activity.php @@ -1060,6 +1060,18 @@ class Activity } $this->entry = $entry; + + // @fixme Don't send in a DOMDocument + if ($feed instanceof DOMDocument) { + common_log( + LOG_WARNING, + 'Activity::__construct() - ' + . 'DOMDocument passed in for feed by mistake. ' + . "Expecting a 'feed' DOMElement." + ); + $feed = $feed->getElementsByTagName('feed')->item(0); + } + $this->feed = $feed; $pubEl = $this->_child($entry, self::PUBLISHED, self::ATOM); From ce9d1618851156cc225a56980c4268a5fe102806 Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Thu, 4 Mar 2010 00:29:13 -0500 Subject: [PATCH 6/7] Added the inverse icons for badge, sandbox, speech, admin --- theme/base/images/icons/README | 4 ++++ theme/base/images/icons/icons-01.gif | Bin 3792 -> 4095 bytes 2 files changed, 4 insertions(+) diff --git a/theme/base/images/icons/README b/theme/base/images/icons/README index 2e17826029..f701959ca0 100644 --- a/theme/base/images/icons/README +++ b/theme/base/images/icons/README @@ -46,6 +46,10 @@ White underscore with green background White C with green background White magic wand with green background + Green badge with white background + Green sandbox with white background + Green speech bubble broken with white background + Green person with tie with white background */ Created by various authors diff --git a/theme/base/images/icons/icons-01.gif b/theme/base/images/icons/icons-01.gif index 210c44511d9ca31b2b359df4b8b8a60ca9f71100..7c22356738044fb15b7643bcff012f74d216766b 100644 GIT binary patch delta 364 zcmV-y0h9jF9seH;M@dFFIbj+ApbF>yu?+qK6#xJKA^8LW3IP8AEC2ui02%SdS3PO}PXpy>knYbC8zqyeM zNSwwQl>QK$m8qP|*_#~coXq){xe1+GDVx@5kG$wfAhd~{+}WKCIGf=4oUd7)=6Rk` zG@j)7o$5KA-HDtQc%0U0moUhH#CeqTd7l}GkNWACfBZS0Klz{R>6gZtp8$HB_IaT7 zDW3x>LJ7*A%!K0RTG@2d+o} delta 59 zcmew_e?gYV-P6s&GEs_Q2Iq7CjXeLDMB=9iDE?$& Date: Thu, 4 Mar 2010 00:48:48 -0500 Subject: [PATCH 7/7] Updated styles for unsandbox, unsilence, revoke administrator and moderator icons --- theme/base/images/icons/icons-01.gif | Bin 4095 -> 4080 bytes theme/default/css/display.css | 16 ++++++++++++++-- theme/identica/css/display.css | 16 ++++++++++++++-- 3 files changed, 28 insertions(+), 4 deletions(-) diff --git a/theme/base/images/icons/icons-01.gif b/theme/base/images/icons/icons-01.gif index 7c22356738044fb15b7643bcff012f74d216766b..bf0f1230e5e16d75e630a487708d8a45ed4f6abf 100644 GIT binary patch delta 296 zcmV+@0oVTjAMhWr(hh$ad?$I7FbG07IGZX|n zQTbSt59pg27?i|$nZw!)!CVy+PQ&{SaPo!p5i&44>V%k>7CZu zoyhr{ei@uc*`Cm8moT`T@kyPQ`JCM8mp@6L`MIC>xt@MGobZ3ypE@|8Y=n;}$e#zw zo(hUb=h>iu^q}~umgHHX7J8uxbcRcH{t%p%shrE%n;hw!%=wtP37uLgo7QQMyy!_Fw27VE*_{nIo8bAJuUVevd7e=; zp5*zR>N%a=iJTUAoYrZVFvx(!d6e{dpBadc`stVaIiElIpX`6>m&Tc&0D7DDd7$+v zp93mF3Cf=1>7KMHp5Td|7J8u=sz7MSAZYkC3(}$e@S)FFLn2CziC3bw23sgaq#0VIMtY5{jGQ znVtOTodcqjREjSWw@IH-3ZWG$rTbZ(Tw0f4TBXsMoa>3DWeTOtS)5x+rb^1C@7bhd JIv@c706W8cnn?fv diff --git a/theme/default/css/display.css b/theme/default/css/display.css index 8ca267c338..be341813a5 100644 --- a/theme/default/css/display.css +++ b/theme/default/css/display.css @@ -358,15 +358,27 @@ background-position: 5px -1445px; .entity_delete input.submit { background-position: 5px -1511px; } +.entity_sandbox .form_user_unsandbox input.submit { +background-position: 5px -2568px; +} +.entity_silence .form_user_unsilence input.submit { +background-position: 5px -2633px; +} .entity_role p { background-position: 5px -2436px; } -.entity_role_administrator input.submit { +.entity_role_administrator .form_user_grantrole input.submit { background-position: 5px -983px; } -.entity_role_moderator input.submit { +.entity_role_moderator .form_user_grantrole input.submit { background-position: 5px -1313px; } +.entity_role_administrator .form_user_revokerole input.submit { +background-position: 5px -2699px; +} +.entity_role_moderator .form_user_revokerole input.submit { +background-position: 5px -2501px; +} .form_reset_key input.submit { background-position: 5px -1973px; } diff --git a/theme/identica/css/display.css b/theme/identica/css/display.css index bc27cfb4d0..db85408ebd 100644 --- a/theme/identica/css/display.css +++ b/theme/identica/css/display.css @@ -358,15 +358,27 @@ background-position: 5px -1445px; .entity_delete input.submit { background-position: 5px -1511px; } +.entity_sandbox .form_user_unsandbox input.submit { +background-position: 5px -2568px; +} +.entity_silence .form_user_unsilence input.submit { +background-position: 5px -2633px; +} .entity_role p { background-position: 5px -2436px; } -.entity_role_administrator input.submit { +.entity_role_administrator .form_user_grantrole input.submit { background-position: 5px -983px; } -.entity_role_moderator input.submit { +.entity_role_moderator .form_user_grantrole input.submit { background-position: 5px -1313px; } +.entity_role_administrator .form_user_revokerole input.submit { +background-position: 5px -2699px; +} +.entity_role_moderator .form_user_revokerole input.submit { +background-position: 5px -2501px; +} .form_reset_key input.submit { background-position: 5px -1973px; }