[dw-free] Add ability to subscribe to a particular user's posts to a community
[commit: http://hg.dwscoalition.org/dw-free/rev/2c754f90cdc7]
http://bugs.dwscoalition.org/show_bug.cgi?id=8
Add a notification for subscribing to a user's posts to a community. You can
get to it by clicking on "track this" under an entry by the desired user.
Patch by
sophie.
Files modified:
http://bugs.dwscoalition.org/show_bug.cgi?id=8
Add a notification for subscribing to a user's posts to a community. You can
get to it by clicking on "track this" under an entry by the desired user.
Patch by
Files modified:
- bin/upgrading/en.dat
- cgi-bin/LJ/Event/JournalNewEntry.pm
- htdocs/manage/tracking/entry.bml
--------------------------------------------------------------------------------
diff -r c1545996122e -r 2c754f90cdc7 bin/upgrading/en.dat
--- a/bin/upgrading/en.dat Sat Feb 04 17:55:23 2012 +0800
+++ b/bin/upgrading/en.dat Sat Feb 04 19:42:13 2012 +0800
@@ -1600,6 +1600,8 @@
event.journal_new_entry.friendlist=Someone I subscribe to posts a new entry
+event.journal_new_entry.poster=[[poster]] posts a new entry to [[user]]
+
event.journal_new_entry.tag.community=Someone posts an entry tagged [[tags]] to [[user]]
event.journal_new_entry.tag.user=[[user]] posts a new entry tagged [[tags]]
diff -r c1545996122e -r 2c754f90cdc7 cgi-bin/LJ/Event/JournalNewEntry.pm
--- a/cgi-bin/LJ/Event/JournalNewEntry.pm Sat Feb 04 17:55:23 2012 +0800
+++ b/cgi-bin/LJ/Event/JournalNewEntry.pm Sat Feb 04 19:42:13 2012 +0800
@@ -13,6 +13,7 @@
# Event that is fired when there is a new post in a journal.
# sarg1 = optional tag id to filter on
+# sarg2 = optional poster id to filter on (in a community)
package LJ::Event::JournalNewEntry;
use strict;
@@ -60,6 +61,13 @@
}
}
+ # filter by user?
+ my $suserid = $subscr->arg2;
+ my $su = LJ::load_userid ( $suserid );
+ if ( $su ) {
+ return 0 unless $subscr->journalid && $entry->poster->equals( $su );
+ }
+
# all posts by friends
return 1 if ! $subscr->journalid && $subscr->owner->watches( $self->event_journal );
@@ -396,6 +404,20 @@
});
}
+ # are we filtering on a poster?
+ my $arg2 = $subscr->arg2;
+
+ if ( $arg2 ) {
+ my $postu = LJ::load_userid( $arg2 );
+ if ( $postu ) {
+ return BML::ml( 'event.journal_new_entry.poster',
+ {
+ user => $journal->ljuser_display,
+ poster => $postu->ljuser_display,
+ } );
+ }
+ }
+
return BML::ml('event.journal_new_entry.friendlist') unless $journal;
return BML::ml('event.journal_new_entry.' . ($journal->is_comm ? 'community' : 'user'),
diff -r c1545996122e -r 2c754f90cdc7 htdocs/manage/tracking/entry.bml
--- a/htdocs/manage/tracking/entry.bml Sat Feb 04 17:55:23 2012 +0800
+++ b/htdocs/manage/tracking/entry.bml Sat Feb 04 19:42:13 2012 +0800
@@ -88,7 +88,17 @@
journal => $journal,
entry => $entry,
flags => LJ::Subscription::TRACKING,
- ),
+ );
+
+ push @{ @$categories[0]->{$cat_title} },
+ LJ::Subscription::Pending->new( $remote,
+ event => "JournalNewEntry",
+ arg2 => $entry->posterid,
+ journal => $journal,
+ flags => LJ::Subscription::TRACKING,
+ ) if $journal->is_community;
+
+ push @{ @$categories[0]->{$cat_title} },
LJ::Subscription::Pending->new( $remote,
event => "JournalNewEntry",
journal => $journal,
--------------------------------------------------------------------------------

no subject
no subject
no subject
no subject
no subject
no subject
I'm trying to think of a good way to get around this as it seems like an accessibility issue, but the issue is that the <label> tag is deliberately cut off before the link so that clicking the link doesn't activate the checkbox, which makes sense. In Firefox, it looks like having multiple <label> tags would work, but I'm not sure if it works in other browsers.
Do you think it's worth me opening a bug for this?
no subject
no subject
no subject