[polari/wip/fmuellner/more-style-changes: 2/7] chatView: Fix up some weird indentation
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [polari/wip/fmuellner/more-style-changes: 2/7] chatView: Fix up some weird indentation
- Date: Wed, 27 Feb 2019 16:14:25 +0000 (UTC)
commit 7433648045d0fc84b81f75822857738ece59d879
Author: Florian Müllner <fmuellner gnome org>
Date: Sat Jul 28 18:13:46 2018 +0200
chatView: Fix up some weird indentation
Use local variables to make the ternary expression align properly
without exceeding the line limit.
https://gitlab.gnome.org/GNOME/polari/merge_requests/93
src/chatView.js | 18 ++++++++----------
1 file changed, 8 insertions(+), 10 deletions(-)
---
diff --git a/src/chatView.js b/src/chatView.js
index 6d9af07..e32760a 100644
--- a/src/chatView.js
+++ b/src/chatView.js
@@ -951,19 +951,17 @@ var ChatView = GObject.registerClass({
}
_onMemberKicked(room, member, actor) {
- let message =
- actor ? _("%s has been kicked by %s").format(member.alias,
- actor.alias)
- : _("%s has been kicked").format(member.alias);
- this._insertStatus(message, member.alias, 'left');
+ let [kicked, kicker] = [member.alias, actor ? actor.alias : null];
+ let msg = kicker ? _("%s has been kicked by %s").format(kicked, kicker)
+ : _("%s has been kicked").format(kicked);
+ this._insertStatus(msg, kicked, 'left');
}
_onMemberBanned(room, member, actor) {
- let message =
- actor ? _("%s has been banned by %s").format(member.alias,
- actor.alias)
- : _("%s has been banned").format(member.alias);
- this._insertStatus(message, member.alias, 'left');
+ let [banned, banner] = [member.alias, actor ? actor.alias : null];
+ let msg = banner ? _("%s has been banned by %s").format(banned, banner)
+ : _("%s has been banned").format(banned);
+ this._insertStatus(msg, banned, 'left');
}
_onMemberJoined(room, member) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]