afuna: Cat under a blanket. Text: "Cats are just little people with Fur and Fangs" (Default)
afuna ([personal profile] afuna) wrote in [site community profile] changelog2009-02-22 06:26 pm

[dw-free] Fix inviter code when creating a journal

[commit: http://hg.dwscoalition.org/dw-free/rev/8dc39a66fdcf]

http://bugs.dwscoalition.org/show_bug.cgi?id=347

Fire notification email, add rel when user creates a journal from an invite.

Patch by [personal profile] janinedog.

--------------------------------------------------------------------------------
diff -r fb01cc537045 -r 8dc39a66fdcf htdocs/create.bml
--- a/htdocs/create.bml	Sun Feb 22 16:04:43 2009 +0000
+++ b/htdocs/create.bml	Sun Feb 22 18:25:30 2009 +0000
@@ -327,7 +327,6 @@ if ( $LJ::HUMAN_CHECK{create} && $mode e
                                             'email'      => $email,
                                             'password'   => $POST{password1},
                                             'get_ljnews' => $POST{news},
-                                            'inviter'    => $inviter,
                                             'underage'   => $is_underage,
                                             'ofage'      => $ofage,
                                            );
@@ -421,24 +420,10 @@ if ( $LJ::HUMAN_CHECK{create} && $mode e
              my $ijoinsstr = join(',', @ijoins);
              LJ::statushistory_add($nu->id, $ivf->{userid}, 'create_from_invite',
                                    "Recommended: $POST{inviter_joins}\nJoined: $ijoinsstr");
+             LJ::set_rel( $nu, $ivf, "I" );
 
              # Send the inviter an email
-             my $body = BML::ml('.email.invite.body', {
-                 username   => $ivf->{user},
-                 sitename   => $LJ::SITENAMESHORT,
-                 infolink   => "$LJ::SITEROOT/userinfo.bml?user=$nu->{user}",
-                 invitelink => "$LJ::SITEROOT/manage/circle/invite.bml"
-                 });
-
-             LJ::send_mail({
-                 'to' => $ivf->{email},
-                 'from' => $LJ::ADMIN_EMAIL,
-                 'fromname' => $LJ::SITENAME,
-                 'charset' => 'utf-8',
-                 'subject' => BML::ml('.email.invite.subject', {'sitename' => $LJ::SITENAMESHORT}),
-                 'body' => $body,
-             });
-
+             LJ::Event::InvitedFriendJoins->new( $ivf, $nu )->fire;
          }
 
          if ($LJ::TOS_CHECK) {
diff -r fb01cc537045 -r 8dc39a66fdcf htdocs/create.bml.text
--- a/htdocs/create.bml.text	Sun Feb 22 16:04:43 2009 +0000
+++ b/htdocs/create.bml.text	Sun Feb 22 18:25:30 2009 +0000
@@ -53,20 +53,6 @@
 .email.head=Your email address
 
 .email.input.head=Email Address:
-
-.email.invite.body<<
-Dear [[username]],
-
-One of the people you invited to join [[sitename]] has accepted your invitation.  Here's a link to their new user info page:
-[[infolink]]
-
-If you'd like to invite more friends, follow this link:
-[[invitelink]]
-
-Thanks for supporting [[sitename]]!
-.
-
-.email.invite.subject=[[sitename]] Friend Invitation Accepted
 
 .email.text2=For verification and security purposes, we need your email address.  It will never ever, under any circumstances, be sold or given away to spammers.  We hate that more than anything.  Read our <a [[aopts]]>privacy policy</a> for more information.
 
--------------------------------------------------------------------------------