Fix bug with message about user rename

This commit is contained in:
Dmitriy Simushev 2012-10-11 13:35:11 +00:00
parent 4102ce00f3
commit 3f39164db1

View File

@ -847,6 +847,8 @@ Class Thread {
public function renameUser($new_name) { public function renameUser($new_name) {
// Rename only if a new name is realy new // Rename only if a new name is realy new
if ($this->userName != $new_name) { if ($this->userName != $new_name) {
// Save old name
$old_name = $this->userName;
// Rename user // Rename user
$this->userName = $new_name; $this->userName = $new_name;
$this->save(); $this->save();
@ -854,7 +856,7 @@ Class Thread {
// Send message about renaming // Send message about renaming
$message = getstring2_( $message = getstring2_(
"chat.status.user.changedname", "chat.status.user.changedname",
array($this->userName, $new_name), array($old_name, $new_name),
$this->locale $this->locale
); );
$this->postMessage(self::KIND_EVENTS, $message); $this->postMessage(self::KIND_EVENTS, $message);