[dw-free] create/setup.bml sends multiple subscription/access ESN if interests error
[commit: http://hg.dwscoalition.org/dw-free/rev/11d9be19dc1d]
http://bugs.dwscoalition.org/show_bug.cgi?id=2030
Don't re-add if we're already watching/subscribed to/joined to the
community, to avoid duplicate processing.
Patch by
kareila.
Files modified:
http://bugs.dwscoalition.org/show_bug.cgi?id=2030
Don't re-add if we're already watching/subscribed to/joined to the
community, to avoid duplicate processing.
Patch by
Files modified:
- cgi-bin/LJ/Widget/CreateAccountInviter.pm
--------------------------------------------------------------------------------
diff -r 1549cf5453b1 -r 11d9be19dc1d cgi-bin/LJ/Widget/CreateAccountInviter.pm
--- a/cgi-bin/LJ/Widget/CreateAccountInviter.pm Wed Oct 20 12:04:40 2010 +0800
+++ b/cgi-bin/LJ/Widget/CreateAccountInviter.pm Wed Oct 20 12:08:10 2010 +0800
@@ -139,14 +139,14 @@ sub handle_post {
if ( $key =~ /^inviter_trust_(\d+)$/ ) {
my $trustu = LJ::load_userid( $1 );
$u->add_edge( $trustu, trust => {} )
- if LJ::isu( $trustu );
+ if LJ::isu( $trustu ) && ! $u->trusts( $trustu );
} elsif ( $key =~ /inviter_watch_(\d+)$/ ) {
my $watchu = LJ::load_userid( $1 );
$u->add_edge( $watchu, watch => {} )
- if LJ::isu( $watchu );
+ if LJ::isu( $watchu ) && ! $u->watches( $watchu );
} elsif ( $key =~ /inviter_join_(\d+)$/ ) {
my $joinu = LJ::load_userid( $1 );
- if ( LJ::isu( $joinu ) ) {
+ if ( LJ::isu( $joinu ) && ! $u->member_of( $joinu ) ) {
# try to join the community
# if it fails and the community's moderated, send a join request and watch it
unless ( $u->join_community( $joinu, 1 ) ) {
--------------------------------------------------------------------------------
