[livejournal] r17210: LJSUP-6636 (Converting a Facebook accoun...
Committer: ailyin
LJSUP-6636 (Converting a Facebook account gives a confusing notification)U trunk/cgi-bin/LJ/User/Rename.pm
Modified: trunk/cgi-bin/LJ/User/Rename.pm
===================================================================
--- trunk/cgi-bin/LJ/User/Rename.pm 2010-08-27 04:11:49 UTC (rev 17209)
+++ trunk/cgi-bin/LJ/User/Rename.pm 2010-08-27 04:35:53 UTC (rev 17210)
@@ -94,6 +94,8 @@
## opt_redir - If true and 'preserve_old_username' is true, then
## the account created with old username will be 'redirect' flagged.
## This option is 'on' by default for non-personal accounts (historically)
+## nonotify - If true, no SecurityAttributeChanged ESN
+## event will be emitted when renaming
## $opts->{token} || "[unknown]" will be put into 'renames' DB table if $opts->{renid} is false
## Output:
## true or false
@@ -186,15 +188,16 @@
$u->kill_session;
- my @date = localtime(time);
- LJ::Event::SecurityAttributeChanged->new($u , {
- action => 'account_renamed',
- old_username => $from,
- ip => ($opts->{ip} || (LJ::is_web_context() ? LJ::Request->remote_ip() : '127.0.0.1')),
- datetime => sprintf("%02d:%02d %02d/%02d/%04d", @date[2,1], $date[3], $date[4]+1, $date[5]+1900),
- })->fire;
+ unless ($opts->{'nonotify'}) {
+ my @date = localtime(time);
+ LJ::Event::SecurityAttributeChanged->new($u , {
+ action => 'account_renamed',
+ old_username => $from,
+ ip => ($opts->{ip} || (LJ::is_web_context() ? LJ::Request->remote_ip() : '127.0.0.1')),
+ datetime => sprintf("%02d:%02d %02d/%02d/%04d", @date[2,1], $date[3], $date[4]+1, $date[5]+1900),
+ })->fire;
+ }
-
if ($u->{journaltype} eq 'P') {
## "Remove all users from your Friends list and leave all communities"
if ($opts->{opt_delfriends}) {
