Skip to content

Commit

Permalink
Add settings for set user's name to alias in message
Browse files Browse the repository at this point in the history
  • Loading branch information
Maki Nishifuji committed May 25, 2016
1 parent 0dbfa4d commit efad8e1
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions packages/rocketchat-lib/i18n/en.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -653,6 +653,8 @@
"Message_MaxAllowedSize" : "Maximum Allowed Message Size",
"Message_pinning" : "Message pinning",
"Message_removed" : "Message removed",
"Message_SetNameToAliasEnabled" : "Set a user name to alias in message",
"Message_SetNameToAliasEnabled_Description" : "Only if not already set alias. The old messages alias not changed if user has changed the name.",
"Message_ShowDeletedStatus" : "Show Deleted Status",
"Message_ShowEditedStatus" : "Show Edited Status",
"Message_ShowFormattingTips" : "Show Formatting Tips",
Expand Down
4 changes: 3 additions & 1 deletion packages/rocketchat-lib/i18n/ja.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -650,6 +650,8 @@
"Message_MaxAllowedSize" : "メッセージの最大文字数",
"Message_pinning" : "ピニングメッセージ",
"Message_removed" : "メッセージを削除しました",
"Message_SetNameToAliasEnabled" : "ユーザの名前をメッセージのエイリアスにセット",
"Message_SetNameToAliasEnabled_Description" : "エイリアスが既にセットされていない場合のみ。古いメッセージのエイリアスは、ユーザが名前を変えたとしても変更されません。",
"Message_ShowDeletedStatus" : "削除した状態を表示する",
"Message_ShowEditedStatus" : "編集した状態を表示する",
"Message_ShowFormattingTips" : "書式のヒントを表示する",
Expand Down Expand Up @@ -1162,4 +1164,4 @@
"Your_mail_was_sent_to_s" : "メールは %s へを送信されました",
"Your_password_is_wrong" : "パスワードが間違っています!",
"Your_push_was_sent_to_s_devices" : "プッシュ通知が %s 台のデバイスへ送信されました"
}
}
2 changes: 1 addition & 1 deletion packages/rocketchat-lib/server/methods/sendMessage.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Meteor.methods
}
return false

message.alias = message.alias or user.name
message.alias = user.name if not message.alias? and RocketChat.settings.get 'Message_SetNameToAliasEnabled'

RocketChat.sendMessage user, message, room

Expand Down
1 change: 1 addition & 0 deletions packages/rocketchat-lib/server/startup/settings.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ RocketChat.settings.addGroup 'Message', ->
@add 'Message_MaxAll', 0, { type: 'int', public: true }
@add 'Message_MaxAllowedSize', 5000, { type: 'int', public: true }
@add 'Message_ShowFormattingTips', true, { type: 'boolean', public: true }
@add 'Message_SetNameToAliasEnabled', false, { type: 'boolean', public: false, i18nDescription: 'Message_SetNameToAliasEnabled_Description' }
@add 'Message_AudioRecorderEnabled', true, { type: 'boolean', public: true, i18nDescription: 'Message_AudioRecorderEnabledDescription' }
@add 'Message_GroupingPeriod', 300, { type: 'int', public: true, i18nDescription: 'Message_GroupingPeriodDescription' }
@add 'API_Embed', true, { type: 'boolean', public: true }
Expand Down

0 comments on commit efad8e1

Please sign in to comment.