[polari] style: Change method indentation style
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [polari] style: Change method indentation style
- Date: Tue, 7 May 2019 19:00:19 +0000 (UTC)
commit fd8650dba015bbe61dbb58f4aaab8416475827c4
Author: Florian Müllner <fmuellner gnome org>
Date: Sat Jul 28 18:28:50 2018 +0200
style: Change method indentation style
Instead of aligning arguments, use a four-space indent.
https://gitlab.gnome.org/GNOME/polari/merge_requests/117
src/accountsMonitor.js | 2 +-
src/appNotifications.js | 9 ++--
src/application.js | 70 +++++++++++++-------------
src/chatView.js | 125 +++++++++++++++++++++++++----------------------
src/connections.js | 29 +++++------
src/entryArea.js | 39 +++++++--------
src/initialSetup.js | 4 +-
src/ircParser.js | 8 +--
src/joinDialog.js | 18 +++----
src/mainWindow.js | 31 ++++++------
src/pasteManager.js | 13 ++---
src/roomList.js | 44 +++++++++--------
src/roomManager.js | 6 +--
src/roomStack.js | 8 +--
src/serverRoomManager.js | 17 ++++---
src/tabCompletion.js | 5 +-
src/telepathyClient.js | 39 ++++++++-------
src/userList.js | 77 +++++++++++++++++------------
src/userTracker.js | 4 +-
19 files changed, 289 insertions(+), 259 deletions(-)
---
diff --git a/src/accountsMonitor.js b/src/accountsMonitor.js
index ca3613f..0beebe4 100644
--- a/src/accountsMonitor.js
+++ b/src/accountsMonitor.js
@@ -18,7 +18,7 @@ var AccountsMonitor = class {
if (!this._app.isTestInstance) {
this._app.connect('prepare-shutdown',
- this._onPrepareShutdown.bind(this));
+ this._onPrepareShutdown.bind(this));
}
let factory = new ClientFactory();
diff --git a/src/appNotifications.js b/src/appNotifications.js
index da0c5fd..8dfeb21 100644
--- a/src/appNotifications.js
+++ b/src/appNotifications.js
@@ -17,7 +17,7 @@ class AppNotification extends Gtk.Revealer {
transition_type: Gtk.RevealerTransitionType.SLIDE_DOWN
});
this.connect('notify::child-revealed',
- this._onChildRevealed.bind(this));
+ this._onChildRevealed.bind(this));
}
close() {
@@ -106,9 +106,10 @@ class CommandOutputNotification extends AppNotification {
super._init();
this.transition_type = Gtk.RevealerTransitionType.SLIDE_UP;
- GLib.timeout_add_seconds(GLib.PRIORITY_DEFAULT,
- COMMAND_OUTPUT_REVEAL_TIME,
- this.close.bind(this));
+ GLib.timeout_add_seconds(
+ GLib.PRIORITY_DEFAULT,
+ COMMAND_OUTPUT_REVEAL_TIME,
+ this.close.bind(this));
}
});
diff --git a/src/application.js b/src/application.js
index 1411182..3940296 100644
--- a/src/application.js
+++ b/src/application.js
@@ -39,19 +39,19 @@ var Application = GObject.registerClass({
this._windowRemovedId = 0;
this.add_main_option('start-client', 0,
- GLib.OptionFlags.NONE, GLib.OptionArg.NONE,
- _('Start Telepathy client'), null);
+ GLib.OptionFlags.NONE, GLib.OptionArg.NONE,
+ _('Start Telepathy client'), null);
// Only included for --help output, the actual option is handled
// from C before handling over control to JS
this.add_main_option('debugger', 'd',
- GLib.OptionFlags.NONE, GLib.OptionArg.NONE,
- _('Start in debug mode'), null);
+ GLib.OptionFlags.NONE, GLib.OptionArg.NONE,
+ _('Start in debug mode'), null);
this.add_main_option('test-instance', 0,
- GLib.OptionFlags.NONE, GLib.OptionArg.NONE,
- _('Allow running alongside another instance'), null);
+ GLib.OptionFlags.NONE, GLib.OptionArg.NONE,
+ _('Allow running alongside another instance'), null);
this.add_main_option('version', 0,
- GLib.OptionFlags.NONE, GLib.OptionArg.NONE,
- _('Print version and exit'), null);
+ GLib.OptionFlags.NONE, GLib.OptionArg.NONE,
+ _('Print version and exit'), null);
this.connect('handle-local-options', (o, dict) => {
let v = dict.lookup_value('test-instance', null);
if (v && v.get_boolean())
@@ -99,8 +99,8 @@ var Application = GObject.registerClass({
let proxy = null;
try {
- proxy = Gio.DBusProxy.new_sync(conn, flags, null,
- name, opath, iface, null);
+ proxy = Gio.DBusProxy.new_sync(
+ conn, flags, null, name, opath, iface, null);
} catch (e) {}
return proxy != null && proxy.get_name_owner() != null;
@@ -152,20 +152,20 @@ var Application = GObject.registerClass({
GLib.setenv('IDLE_PERSIST', '1', false);
this._ensureService(conn,
- Tp.ACCOUNT_MANAGER_BUS_NAME,
- Tp.ACCOUNT_MANAGER_OBJECT_PATH,
- Tp.ACCOUNT_MANAGER_BUS_NAME,
- '/app/libexec/mission-control-5');
+ Tp.ACCOUNT_MANAGER_BUS_NAME,
+ Tp.ACCOUNT_MANAGER_OBJECT_PATH,
+ Tp.ACCOUNT_MANAGER_BUS_NAME,
+ '/app/libexec/mission-control-5');
this._ensureService(conn,
- `${Tp.CM_BUS_NAME_BASE}idle`,
- `${Tp.CM_OBJECT_PATH_BASE}idle`,
- 'org.freedesktop.Telepathy.ConnectionManager',
- '/app/libexec/telepathy-idle');
+ `${Tp.CM_BUS_NAME_BASE}idle`,
+ `${Tp.CM_OBJECT_PATH_BASE}idle`,
+ 'org.freedesktop.Telepathy.ConnectionManager',
+ '/app/libexec/telepathy-idle');
this._ensureService(conn,
- `${Tp.CLIENT_BUS_NAME_BASE}Logger`,
- `${Tp.CLIENT_OBJECT_PATH_BASE}Logger`,
- Tp.IFACE_CLIENT,
- '/app/libexec/telepathy-logger');
+ `${Tp.CLIENT_BUS_NAME_BASE}Logger`,
+ `${Tp.CLIENT_OBJECT_PATH_BASE}Logger`,
+ Tp.IFACE_CLIENT,
+ '/app/libexec/telepathy-logger');
return true;
}
@@ -286,8 +286,9 @@ var Application = GObject.registerClass({
if (actionEntry.change_state)
action.connect('change-state', actionEntry.change_state);
if (actionEntry.accels) {
- this.set_accels_for_action(`app.${actionEntry.name}`,
- actionEntry.accels);
+ this.set_accels_for_action(
+ `app.${actionEntry.name}`,
+ actionEntry.accels);
}
this.add_action(action);
});
@@ -328,7 +329,7 @@ var Application = GObject.registerClass({
}
this._accountsMonitor.connect('account-status-changed',
- this._onAccountStatusChanged.bind(this));
+ this._onAccountStatusChanged.bind(this));
this._accountsMonitor.connect('account-added', (am, account) => {
// Reset nickname at startup
let accountName = this._getTrimmedAccountName(account);
@@ -354,8 +355,8 @@ var Application = GObject.registerClass({
logError(e, 'Failed to add application style');
}
Gtk.StyleContext.add_provider_for_screen(Gdk.Screen.get_default(),
- provider,
- Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION);
+ provider,
+ Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION);
}
vfunc_activate() {
@@ -379,9 +380,9 @@ var Application = GObject.registerClass({
this.emit('prepare-shutdown');
});
window.connect('notify::active-room',
- () => this.emit('room-focus-changed'));
+ () => this.emit('room-focus-changed'));
window.connect('notify::is-active',
- () => this.emit('room-focus-changed'));
+ () => this.emit('room-focus-changed'));
}
}
@@ -401,7 +402,7 @@ var Application = GObject.registerClass({
action.enabled = window.active_room != null;
window.connect('active-room-state-changed',
- this._updateUserListAction.bind(this));
+ this._updateUserListAction.bind(this));
this._updateUserListAction();
}
@@ -440,8 +441,9 @@ var Application = GObject.registerClass({
});
if (matches.length) {
- joinAction.activate(new GLib.Variant('(ssu)',
- [matches[0], `#${room}`, time]));
+ joinAction.activate(new GLib.Variant('(ssu)', [
+ matches[0], `#${room}`, time
+ ]));
} else {
this._createAccount(matchedId, server, port, a => {
if (a) {
@@ -463,8 +465,8 @@ var Application = GObject.registerClass({
success = true;
} catch (e) {
let label = _('Failed to open link');
- let n = new AppNotifications.MessageNotification(label,
- 'dialog-error-symbolic');
+ let n = new AppNotifications.MessageNotification(
+ label, 'dialog-error-symbolic');
this.notificationQueue.addNotification(n);
}
diff --git a/src/chatView.js b/src/chatView.js
index 076c5a0..11e3e36 100644
--- a/src/chatView.js
+++ b/src/chatView.js
@@ -80,7 +80,7 @@ class TextView extends Gtk.TextView {
let iter = this.buffer.get_iter_at_mark(mark);
let location = this.get_iter_location(iter);
let [, y] = this.buffer_to_window_coords(Gtk.TextWindowType.TEXT,
- location.x, location.y);
+ location.x, location.y);
let tags = iter.get_tags();
let pixelsAbove = tags.reduce((prev, current) => {
@@ -312,21 +312,21 @@ var ChatView = GObject.registerClass({
});
this.vadjustment.connect('value-changed',
- this._onValueChanged.bind(this));
+ this._onValueChanged.bind(this));
this.vadjustment.connect('changed', this._updateScroll.bind(this));
this._view.connect('key-press-event', this._onKeyPress.bind(this));
this._view.connect('motion-notify-event',
- this._handleButtonTagsHover.bind(this));
+ this._handleButtonTagsHover.bind(this));
this._view.connect('enter-notify-event',
- this._handleButtonTagsHover.bind(this));
+ this._handleButtonTagsHover.bind(this));
this._view.connect('leave-notify-event',
- this._handleButtonTagsHover.bind(this));
+ this._handleButtonTagsHover.bind(this));
/* pick up DPI changes (e.g. via the 'text-scaling-factor' setting):
the default handler calls pango_cairo_context_set_resolution(), so
update the indent after that */
this._view.connect_after('style-updated',
- this._updateIndent.bind(this));
+ this._updateIndent.bind(this));
this._room = room;
this._state = { lastNick: null, lastTimestamp: 0, lastStatusGroup: 0 };
@@ -354,25 +354,24 @@ var ChatView = GObject.registerClass({
identifier: room.channel_name
});
let logManager = Tpl.LogManager.dup_singleton();
- this._logWalker =
- logManager.walk_filtered_events(room.account, target,
- Tpl.EventTypeMask.TEXT, null);
+ this._logWalker = logManager.walk_filtered_events(
+ room.account, target,
+ Tpl.EventTypeMask.TEXT, null);
this._fetchingBacklog = true;
this._logWalker.get_events_async(NUM_INITIAL_LOG_EVENTS,
- this._onLogEventsReady.bind(this));
+ this._onLogEventsReady.bind(this));
this._autoscroll = true;
this._app = Gio.Application.get_default();
DropTargetIface.addTargets(this, this._view);
- this._roomFocusChangedId =
- this._app.connect('room-focus-changed',
- this._checkMessages.bind(this));
+ this._roomFocusChangedId = this._app.connect('room-focus-changed',
+ this._checkMessages.bind(this));
- this._hoverCursor = Gdk.Cursor.new_from_name(this.get_display(),
- 'pointer');
+ this._hoverCursor = Gdk.Cursor.new_from_name(
+ this.get_display(), 'pointer');
this._channelSignals = [];
this._channel = null;
@@ -405,9 +404,8 @@ var ChatView = GObject.registerClass({
});
this._onChannelChanged();
- this._nickStatusChangedId =
- this._userTracker.watchRoomStatus(this._room, null,
- this._onNickStatusChanged.bind(this));
+ this._nickStatusChangedId = this._userTracker.watchRoomStatus(
+ this._room, null, this._onNickStatusChanged.bind(this));
}
_createTags() {
@@ -471,9 +469,10 @@ var ChatView = GObject.registerClass({
this._hoveredLinkColor = _getColor(context);
context.restore();
- let desaturatedNickColor = (this._activeNickColor.red +
- this._activeNickColor.blue +
- this._activeNickColor.green) / 3;
+ let desaturatedNickColor = (
+ this._activeNickColor.red +
+ this._activeNickColor.blue +
+ this._activeNickColor.green) / 3;
this._inactiveNickColor = new Gdk.RGBA({
red: desaturatedNickColor,
green: desaturatedNickColor,
@@ -540,8 +539,8 @@ var ChatView = GObject.registerClass({
this._backlogTimeoutId = 0;
if (this._nickStatusChangedId) {
- this._userTracker.unwatchRoomStatus(this._room,
- this._nickStatusChangedId);
+ this._userTracker.unwatchRoomStatus(
+ this._room, this._nickStatusChangedId);
}
this._nickStatusChangedId = 0;
this._userTracker = null;
@@ -667,8 +666,9 @@ var ChatView = GObject.registerClass({
_updateIndent() {
let context = this._view.get_pango_context();
let metrics = context.get_metrics(null, null);
- let charWidth = Math.max(metrics.get_approximate_char_width(),
- metrics.get_approximate_digit_width());
+ let charWidth = Math.max(
+ metrics.get_approximate_char_width(),
+ metrics.get_approximate_digit_width());
let pixelWidth = Pango.units_to_double(charWidth);
let totalWidth = this._maxNickChars * pixelWidth + NICK_SPACING;
@@ -686,7 +686,7 @@ var ChatView = GObject.registerClass({
if (this._pending.size == 0) {
this._view.emit('move-cursor',
- Gtk.MovementStep.BUFFER_ENDS, 1, false);
+ Gtk.MovementStep.BUFFER_ENDS, 1, false);
} else {
this._autoscroll = false;
let mark = [...this._pending.values()].shift();
@@ -714,14 +714,12 @@ var ChatView = GObject.registerClass({
if (keyval === Gdk.KEY_Home ||
keyval === Gdk.KEY_KP_Home) {
this._view.emit('move-cursor',
- Gtk.MovementStep.BUFFER_ENDS,
- -1, false);
+ Gtk.MovementStep.BUFFER_ENDS, -1, false);
return Gdk.EVENT_STOP;
} else if (keyval === Gdk.KEY_End ||
keyval === Gdk.KEY_KP_End) {
this._view.emit('move-cursor',
- Gtk.MovementStep.BUFFER_ENDS,
- 1, false);
+ Gtk.MovementStep.BUFFER_ENDS, 1, false);
return Gdk.EVENT_STOP;
}
@@ -748,7 +746,7 @@ var ChatView = GObject.registerClass({
this._showLoadingIndicator();
this._backlogTimeoutId = GLib.timeout_add(GLib.PRIORITY_DEFAULT, 500, () => {
this._logWalker.get_events_async(NUM_LOG_EVENTS,
- this._onLogEventsReady.bind(this));
+ this._onLogEventsReady.bind(this));
this._backlogTimeoutId = 0;
return GLib.SOURCE_REMOVE;
});
@@ -805,7 +803,7 @@ var ChatView = GObject.registerClass({
_handleButtonTagsHover(view, event) {
let [, eventX, eventY] = event.get_coords();
let [x, y] = view.window_to_buffer_coords(Gtk.TextWindowType.WIDGET,
- eventX, eventY);
+ eventX, eventY);
let [inside, iter] = view.get_iter_at_location(x, y);
let hoveredButtonTags;
@@ -1057,8 +1055,9 @@ var ChatView = GObject.registerClass({
buffer.tag_table.add(headerArrowTag);
buffer.tag_table.add(groupTag);
- groupTag.bind_property('invisible', headerArrowTag, 'invisible',
- GObject.BindingFlags.INVERT_BOOLEAN);
+ groupTag.bind_property('invisible',
+ headerArrowTag, 'invisible',
+ GObject.BindingFlags.INVERT_BOOLEAN);
headerTag.connect('clicked', () => {
groupTag.invisible = !groupTag.invisible;
@@ -1069,7 +1068,8 @@ var ChatView = GObject.registerClass({
});
this._ensureNewLine();
- headerMark = buffer.create_mark('idle-status-start', buffer.get_end_iter(), true);
+ headerMark = buffer.create_mark('idle-status-start',
+ buffer.get_end_iter(), true);
} else {
headerTag = this._lookupTag(headerTagName);
headerArrowTag = this._lookupTag(headerArrowTagName);
@@ -1089,12 +1089,18 @@ var ChatView = GObject.registerClass({
let stats = [];
if (this._statusCount.joined > 0) {
- stats.push(ngettext('%d user joined',
- '%d users joined',
this._statusCount.joined).format(this._statusCount.joined));
+ stats.push(
+ ngettext(
+ '%d user joined',
+ '%d users joined', this._statusCount.joined)
+ .format(this._statusCount.joined));
}
if (this._statusCount.left > 0) {
- stats.push(ngettext('%d user left',
- '%d users left', this._statusCount.left).format(this._statusCount.left));
+ stats.push(
+ ngettext(
+ '%d user left',
+ '%d users left', this._statusCount.left)
+ .format(this._statusCount.left));
}
// TODO: How do we update the arrow direction when text direction change?
let iter = buffer.get_iter_at_mark(headerMark);
@@ -1102,8 +1108,9 @@ var ChatView = GObject.registerClass({
let headerText = stats.join(', ');
let baseDir = Pango.find_base_dir(headerText, -1);
this._insertWithTags(iter, headerText, tags);
- this._insertWithTags(iter, baseDir == Pango.Direction.LTR ? '\u25B6' : '\u25C0',
- tags.concat(headerArrowTag));
+ this._insertWithTags(iter,
+ baseDir == Pango.Direction.LTR ? '\u25B6' : '\u25C0',
+ tags.concat(headerArrowTag));
this._insertWithTags(iter, '\u25BC', tags.concat(groupTag));
}
@@ -1143,14 +1150,16 @@ var ChatView = GObject.registerClass({
let now = GLib.DateTime.new_now_local();
// 00:01 actually, just to be safe
- let todayMidnight = GLib.DateTime.new_local(now.get_year(),
- now.get_month(),
- now.get_day_of_month(),
- 0, 1, 0);
- let dateMidnight = GLib.DateTime.new_local(date.get_year(),
- date.get_month(),
- date.get_day_of_month(),
- 0, 1, 0);
+ let todayMidnight = GLib.DateTime.new_local(
+ now.get_year(),
+ now.get_month(),
+ now.get_day_of_month(),
+ 0, 1, 0);
+ let dateMidnight = GLib.DateTime.new_local(
+ date.get_year(),
+ date.get_month(),
+ date.get_day_of_month(),
+ 0, 1, 0);
let daysAgo = todayMidnight.difference(dateMidnight) / GLib.TIME_SPAN_DAY;
let format;
@@ -1235,8 +1244,8 @@ var ChatView = GObject.registerClass({
_insertMessage(iter, message, state) {
let isAction = message.messageType == Tp.ChannelTextMessageType.ACTION;
let needsGap = message.nick != state.lastNick || isAction;
- let highlight = this._room.should_highlight_message(message.nick,
- message.text);
+ let highlight = this._room.should_highlight_message(
+ message.nick, message.text);
if (message.timestamp - TIMESTAMP_INTERVAL > state.lastTimestamp) {
let tags = [this._lookupTag('timestamp')];
@@ -1244,8 +1253,7 @@ var ChatView = GObject.registerClass({
tags.push(this._lookupTag('gap'));
needsGap = false;
this._insertWithTags(iter,
- `${this._formatTimestamp(message.timestamp)}\n`,
- tags);
+ `${this._formatTimestamp(message.timestamp)}\n`, tags);
}
state.lastTimestamp = message.timestamp;
@@ -1321,16 +1329,17 @@ var ChatView = GObject.registerClass({
this._view.get_buffer().tag_table.add(tag);
let name = url.name ? url.name : url.url;
- this._insertWithTags(iter, name,
- tags.concat(this._lookupTag('url'), tag));
+ this._insertWithTags(iter,
+ name, tags.concat(this._lookupTag('url'), tag));
pos = url.pos + name.length;
}
this._insertWithTags(iter, text.substr(pos), tags);
if (highlight && message.pendingId) {
- this._pending.set(message.pendingId,
- this._view.buffer.create_mark(null, iter, true));
+ this._pending.set(
+ message.pendingId,
+ this._view.buffer.create_mark(null, iter, true));
}
}
@@ -1364,7 +1373,7 @@ var ChatView = GObject.registerClass({
let event = Gtk.get_current_event();
let [, eventX, eventY] = event.get_coords();
let [x, y] = view.window_to_buffer_coords(Gtk.TextWindowType.WIDGET,
- eventX, eventY);
+ eventX, eventY);
let [inside_, start] = view.get_iter_at_location(x, y);
let end = start.copy();
diff --git a/src/connections.js b/src/connections.js
index a0bfb73..fc6d4cc 100644
--- a/src/connections.js
+++ b/src/connections.js
@@ -42,8 +42,9 @@ class ConnectionRow extends Gtk.ListBoxRow {
let name = NetworksManager.getDefault().getNetworkName(this._id);
this.name = `ConnectionRow ${name}`;
- this.bind_property('sensitive', this, 'activatable',
- GObject.BindingFlags.SYNC_CREATE);
+ this.bind_property('sensitive',
+ this, 'activatable',
+ GObject.BindingFlags.SYNC_CREATE);
let box = new Gtk.Box({ spacing: 12, margin: 12 });
this.add(box);
@@ -60,9 +61,10 @@ class ConnectionRow extends Gtk.ListBoxRow {
this.show_all();
- this.bind_property('sensitive', insensitiveDesc, 'visible',
- GObject.BindingFlags.SYNC_CREATE |
- GObject.BindingFlags.INVERT_BOOLEAN);
+ this.bind_property('sensitive',
+ insensitiveDesc, 'visible',
+ GObject.BindingFlags.SYNC_CREATE |
+ GObject.BindingFlags.INVERT_BOOLEAN);
}
get id() {
@@ -131,9 +133,8 @@ var ConnectionsList = GObject.registerClass({
});
this._networksManager = NetworksManager.getDefault();
- let networksChangedId =
- this._networksManager.connect('changed',
- this._networksChanged.bind(this));
+ let networksChangedId = this._networksManager.connect('changed',
+ this._networksChanged.bind(this));
this._networksChanged();
this.connect('destroy', () => {
@@ -296,15 +297,15 @@ var ConnectionDetails = GObject.registerClass({
});
this._nameEntry.connect('changed',
- this._onCanConfirmChanged.bind(this));
+ this._onCanConfirmChanged.bind(this));
this._serverEntry.connect('changed',
- this._onCanConfirmChanged.bind(this));
+ this._onCanConfirmChanged.bind(this));
this._nickEntry.connect('changed',
- this._onCanConfirmChanged.bind(this));
+ this._onCanConfirmChanged.bind(this));
this._realnameEntry.connect('changed',
- this._onCanConfirmChanged.bind(this));
+ this._onCanConfirmChanged.bind(this));
this._sslCheckbox.connect('toggled',
- this._onCanConfirmChanged.bind(this));
+ this._onCanConfirmChanged.bind(this));
let realnameStore = new Gtk.ListStore();
realnameStore.set_column_types([GObject.TYPE_STRING]);
@@ -535,7 +536,7 @@ var ConnectionProperties = GObject.registerClass({
this.set_default_response(Gtk.ResponseType.OK);
let id = account.connect('notify::connection-status',
- this._syncErrorMessage.bind(this));
+ this._syncErrorMessage.bind(this));
this._syncErrorMessage(account);
this.connect('destroy', () => account.disconnect(id));
diff --git a/src/entryArea.js b/src/entryArea.js
index 363cda9..f28c0b9 100644
--- a/src/entryArea.js
+++ b/src/entryArea.js
@@ -192,7 +192,7 @@ var EntryArea = GObject.registerClass({
this.connect('realize', () => {
this._toplevel = this.get_toplevel();
this._keyPressId = this._toplevel.connect('key-press-event',
- this._onKeyPressEvent.bind(this));
+ this._onKeyPressEvent.bind(this));
});
this.connect('map', () => {
this._nickButton.popover = EntryArea._nickPopover;
@@ -278,17 +278,15 @@ var EntryArea = GObject.registerClass({
return;
this._completion = new TabCompletion(this._chatEntry);
- this._membersChangedId =
- this._room.connect('members-changed',
- this._updateCompletions.bind(this));
+ this._membersChangedId = this._room.connect('members-changed',
+ this._updateCompletions.bind(this));
this._nicknameChangedId =
this._room.account.connect('notify::nickname', () => {
if (!this._room.channel)
this._updateNick();
});
- this._channelChangedId =
- this._room.connect('notify::channel',
- this._onChannelChanged.bind(this));
+ this._channelChangedId = this._room.connect('notify::channel',
+ this._onChannelChanged.bind(this));
this._onChannelChanged(this._room);
this._chatEntry.connect('map', this._updateCompletions.bind(this));
@@ -366,14 +364,14 @@ var EntryArea = GObject.registerClass({
}
pasteText(text, nLines) {
- this._confirmLabel.label =
- ngettext('Paste %s line of text to public paste service?',
- 'Paste %s lines of text to public paste service?',
- nLines).format(nLines);
- this._uploadLabel.label =
- ngettext('Uploading %s line of text to public paste service…',
- 'Uploading %s lines of text to public paste service…',
- nLines).format(nLines);
+ this._confirmLabel.label = ngettext(
+ 'Paste %s line of text to public paste service?',
+ 'Paste %s lines of text to public paste service?', nLines)
+ .format(nLines);
+ this._uploadLabel.label = ngettext(
+ 'Uploading %s line of text to public paste service…',
+ 'Uploading %s lines of text to public paste service…', nLines)
+ .format(nLines);
this._setPasteContent(text);
}
@@ -384,10 +382,11 @@ var EntryArea = GObject.registerClass({
}
pasteFile(file) {
- file.query_info_async(Gio.FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME,
- Gio.FileQueryInfoFlags.NONE,
- GLib.PRIORITY_DEFAULT, null,
- this._onFileInfoReady.bind(this));
+ file.query_info_async(
+ Gio.FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME,
+ Gio.FileQueryInfoFlags.NONE,
+ GLib.PRIORITY_DEFAULT, null,
+ this._onFileInfoReady.bind(this));
}
_onFileInfoReady(file, res) {
@@ -447,7 +446,7 @@ var EntryArea = GObject.registerClass({
if (room.channel) {
this._selfAliasChangedId =
room.channel.connection.connect('notify::self-contact',
- this._updateNick.bind(this));
+ this._updateNick.bind(this));
} else {
this._selfAliasChangedId = 0;
}
diff --git a/src/initialSetup.js b/src/initialSetup.js
index cb1e036..03a8157 100644
--- a/src/initialSetup.js
+++ b/src/initialSetup.js
@@ -35,7 +35,7 @@ var InitialSetupWindow = GObject.registerClass({
this.connect('destroy', () => this._unsetAccount());
this._serverRoomList.connect('notify::can-join',
- this._updateNextSensitivity.bind(this));
+ this._updateNextSensitivity.bind(this));
this._nextButton.connect('clicked', () => {
if (this._page == SetupPage.CONNECTION) {
@@ -58,7 +58,7 @@ var InitialSetupWindow = GObject.registerClass({
this._networkMonitor = Gio.NetworkMonitor.get_default();
this._networkMonitor.connect('notify::network-available',
- this._onNetworkAvailableChanged.bind(this));
+ this._onNetworkAvailableChanged.bind(this));
if (this._networkMonitor.state_valid)
this._onNetworkAvailableChanged();
}
diff --git a/src/ircParser.js b/src/ircParser.js
index 83cdc85..eef9bfe 100644
--- a/src/ircParser.js
+++ b/src/ircParser.js
@@ -86,8 +86,8 @@ var IrcParser = class {
} else if (command) {
output = this._createFeedbackUsage(command);
} else {
- output = this._createFeedbackGrid(_('Known commands:'),
- Object.keys(knownCommands));
+ output = this._createFeedbackGrid(
+ _('Known commands:'), Object.keys(knownCommands));
}
break;
}
@@ -188,8 +188,8 @@ var IrcParser = class {
case 'NAMES': {
let channel = this._room.channel;
let members = channel.group_dup_members_contacts().map(m => m.alias);
- output = this._createFeedbackGrid(_('Users on %s:').format(channel.identifier),
- members);
+ output = this._createFeedbackGrid(
+ _('Users on %s:').format(channel.identifier), members);
break;
}
case 'NICK': {
diff --git a/src/joinDialog.js b/src/joinDialog.js
index 70cd220..1ecfad1 100644
--- a/src/joinDialog.js
+++ b/src/joinDialog.js
@@ -41,12 +41,10 @@ var JoinDialog = GObject.registerClass({
this.get_header_bar().pack_start(this._backButton);
let accelGroup = new Gtk.AccelGroup();
- this._connectionButton.add_accelerator('clicked', accelGroup,
- Gdk.KEY_n,
- Gdk.ModifierType.CONTROL_MASK, 0);
- this._backButton.add_accelerator('clicked', accelGroup,
- Gdk.KEY_Left,
- Gdk.ModifierType.MOD1_MASK, 0);
+ this._connectionButton.add_accelerator('clicked',
+ accelGroup, Gdk.KEY_n, Gdk.ModifierType.CONTROL_MASK, 0);
+ this._backButton.add_accelerator('clicked',
+ accelGroup, Gdk.KEY_Left, Gdk.ModifierType.MOD1_MASK, 0);
this.add_accel_group(accelGroup);
this._setupMainPage();
@@ -98,11 +96,11 @@ var JoinDialog = GObject.registerClass({
});
this._connectionCombo.connect('changed',
- this._onAccountChanged.bind(this));
+ this._onAccountChanged.bind(this));
this._connectionCombo.sensitive = false;
this._serverRoomList.connect('notify::can-join',
- this._updateCanJoin.bind(this));
+ this._updateCanJoin.bind(this));
}
_setupConnectionPage() {
@@ -118,9 +116,9 @@ var JoinDialog = GObject.registerClass({
});
this._connectionsList.connect('account-created',
- this._onAccountCreated.bind(this));
+ this._onAccountCreated.bind(this));
this._details.connect('account-created',
- this._onAccountCreated.bind(this));
+ this._onAccountCreated.bind(this));
this._customToggle.connect('notify::active', () => {
let isCustom = this._customToggle.active;
diff --git a/src/mainWindow.js b/src/mainWindow.js
index 962a70d..e31e8ec 100644
--- a/src/mainWindow.js
+++ b/src/mainWindow.js
@@ -154,8 +154,8 @@ var MainWindow = GObject.registerClass({
// the input area, but appear to emerge from it, so
// set up an appropriate margin
this._roomStack.bind_property('entry-area-height',
- app.commandOutputQueue, 'margin-bottom',
- GObject.BindingFlags.SYNC_CREATE);
+ app.commandOutputQueue, 'margin-bottom',
+ GObject.BindingFlags.SYNC_CREATE);
// Make sure user-list button is at least as wide as icon buttons
this._joinButton.connect('size-allocate', (w, rect) => {
@@ -168,16 +168,14 @@ var MainWindow = GObject.registerClass({
this._accountsMonitor = AccountsMonitor.getDefault();
this._accountsMonitor.connect('accounts-changed',
- this._onAccountsChanged.bind(this));
+ this._onAccountsChanged.bind(this));
this._onAccountsChanged(this._accountsMonitor);
this._roomManager = RoomManager.getDefault();
- this._roomsLoadedId =
- this._roomManager.connect('rooms-loaded',
- this._onRoomsLoaded.bind(this));
- this._roomRemovedId =
- this._roomManager.connect('room-removed',
- this._onRoomRemoved.bind(this));
+ this._roomsLoadedId = this._roomManager.connect('rooms-loaded',
+ this._onRoomsLoaded.bind(this));
+ this._roomRemovedId = this._roomManager.connect('room-removed',
+ this._onRoomRemoved.bind(this));
this._onRoomsLoaded();
this._updateUserListLabel();
@@ -196,7 +194,7 @@ var MainWindow = GObject.registerClass({
});
this._gtkSettings.connect('notify::gtk-decoration-layout',
- this._updateDecorations.bind(this));
+ this._updateDecorations.bind(this));
this._updateDecorations();
this.connect('window-state-event', this._onWindowStateEvent.bind(this));
@@ -249,7 +247,7 @@ var MainWindow = GObject.registerClass({
_onDestroy() {
this._settings.set_boolean ('window-maximized', this._isMaximized);
this._settings.set_value('window-size',
- GLib.Variant.new('ai', this._currentSize));
+ new GLib.Variant('ai', this._currentSize));
let serializedChannel = null;
if (this._lastActiveRoom) {
@@ -337,13 +335,13 @@ var MainWindow = GObject.registerClass({
this._displayNameChangedId =
this._room.connect('notify::display-name',
- this._updateTitlebar.bind(this));
+ this._updateTitlebar.bind(this));
this._topicChangedId =
this._room.connect('notify::topic',
- this._updateTitlebar.bind(this));
+ this._updateTitlebar.bind(this));
this._membersChangedId =
this._room.connect('members-changed',
- this._updateUserListLabel.bind(this));
+ this._updateUserListLabel.bind(this));
this._channelChangedId =
this._room.connect('notify::channel', () => {
this._updateUserListLabel();
@@ -390,8 +388,9 @@ var MainWindow = GObject.registerClass({
this._room.channel.has_interface(Tp.IFACE_CHANNEL_INTERFACE_GROUP))
numMembers = this._room.channel.group_dup_members_contacts().length;
- let accessibleName = ngettext('%d user',
- '%d users', numMembers).format(numMembers);
+ let accessibleName = ngettext(
+ '%d user',
+ '%d users', numMembers).format(numMembers);
this._showUserListButton.get_accessible().set_name(accessibleName);
this._showUserListButton.label = `${numMembers}`;
}
diff --git a/src/pasteManager.js b/src/pasteManager.js
index 5b326bc..463877e 100644
--- a/src/pasteManager.js
+++ b/src/pasteManager.js
@@ -34,11 +34,12 @@ var PasteManager = class {
}
_pasteFile(file, title, callback) {
- file.query_info_async(Gio.FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE,
- Gio.FileQueryInfoFlags.NONE,
- GLib.PRIORITY_DEFAULT, null, (file, res) => {
- this._onFileQueryFinish(file, res, title, callback);
- });
+ file.query_info_async(
+ Gio.FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE,
+ Gio.FileQueryInfoFlags.NONE,
+ GLib.PRIORITY_DEFAULT, null, (file, res) => {
+ this._onFileQueryFinish(file, res, title, callback);
+ });
}
_onFileQueryFinish(file, res, title, callback) {
@@ -104,7 +105,7 @@ var DropTargetIface = GObject.registerClass({
widget.connect('drag-leave', this._onDragLeave.bind(this));
widget.connect('drag-motion', this._onDragMotion.bind(this));
widget.connect_after('drag-data-received',
- this._onDragDataReceived.bind(this));
+ this._onDragDataReceived.bind(this));
}
_onDragDrop(widget, context, _x, _y, time) {
diff --git a/src/roomList.js b/src/roomList.js
index a033fab..7b622d8 100644
--- a/src/roomList.js
+++ b/src/roomList.js
@@ -40,21 +40,23 @@ var RoomRow = GObject.registerClass({
this._icon.visible = room.icon != null;
this._eventBox.connect('button-release-event',
- this._onButtonRelease.bind(this));
- this.connect('key-press-event', this._onKeyPress.bind(this));
+ this._onButtonRelease.bind(this));
+ this.connect('key-press-event',
+ this._onKeyPress.bind(this));
- room.bind_property('display-name', this._roomLabel, 'label',
- GObject.BindingFlags.SYNC_CREATE);
+ room.bind_property('display-name',
+ this._roomLabel, 'label',
+ GObject.BindingFlags.SYNC_CREATE);
- let channelChangedId =
- room.connect('notify::channel', this._onChannelChanged.bind(this));
+ let channelChangedId = room.connect('notify::channel',
+ this._onChannelChanged.bind(this));
let connectionStatusChangedId = 0;
if (this._room.type == Tp.HandleType.ROOM) {
connectionStatusChangedId =
this.account.connect('notify::connection-status',
- this._onConnectionStatusChanged.bind(this));
+ this._onConnectionStatusChanged.bind(this));
this._onConnectionStatusChanged();
}
@@ -157,7 +159,7 @@ var RoomRow = GObject.registerClass({
for (let signal of ['message-received', 'pending-message-removed']) {
this._channelSignals.push(
this._room.channel.connect(signal,
- this._updatePending.bind(this))
+ this._updatePending.bind(this))
);
}
this._updatePending();
@@ -190,13 +192,13 @@ var RoomRow = GObject.registerClass({
if (!this._popover) {
let menu = new Gio.Menu();
let isRoom = this._room.type == Tp.HandleType.ROOM;
- menu.append(isRoom ? _('Leave chatroom') : _('End conversation'),
- `app.leave-room(("${this._room.id}", ""))`);
+ let label = isRoom ? _('Leave chatroom') : _('End conversation');
+ menu.append(label, `app.leave-room(("${this._room.id}", ""))`);
this._popover = Gtk.Popover.new_from_model(this, menu);
this._popoverVisibleChangedId =
this._popover.connect('notify::visible',
- _onPopoverVisibleChanged);
+ _onPopoverVisibleChanged);
this._popover.position = Gtk.PositionType.BOTTOM;
}
this._popover.show();
@@ -263,16 +265,16 @@ var RoomListHeader = GObject.registerClass({
let displayNameChangedId =
this._account.connect('notify::display-name',
- this._onDisplayNameChanged.bind(this));
+ this._onDisplayNameChanged.bind(this));
this._onDisplayNameChanged();
let connectionStatusChangedId =
this._account.connect('notify::connection-status',
- this._onConnectionStatusChanged.bind(this));
+ this._onConnectionStatusChanged.bind(this));
let presenceChangedId =
this._account.connect('notify::requested-presence-type',
- this._onRequestedPresenceChanged.bind(this));
+ this._onRequestedPresenceChanged.bind(this));
this._onRequestedPresenceChanged();
this.connect('destroy', () => {
@@ -447,9 +449,9 @@ class RoomList extends Gtk.ListBox {
this._accountsMonitor = AccountsMonitor.getDefault();
this._accountsMonitor.connect('account-added',
- this._accountAdded.bind(this));
+ this._accountAdded.bind(this));
this._accountsMonitor.connect('account-removed',
- this._accountRemoved.bind(this));
+ this._accountRemoved.bind(this));
this._accountsMonitor.connect('account-shown', (mon, account) => {
this._updatePlaceholderVisibility(account);
});
@@ -464,9 +466,9 @@ class RoomList extends Gtk.ListBox {
this._roomManager = RoomManager.getDefault();
this._roomManager.connect('room-added',
- this._roomAdded.bind(this));
+ this._roomAdded.bind(this));
this._roomManager.connect('room-removed',
- this._roomRemoved.bind(this));
+ this._roomRemoved.bind(this));
this._roomManager.rooms.forEach(r => this._roomAdded(this._roomManager, r));
let app = Gio.Application.get_default();
@@ -494,13 +496,13 @@ class RoomList extends Gtk.ListBox {
name: 'next-pending-room',
handler: () => {
this._moveSelectionFull(Gtk.DirectionType.DOWN,
- row => row.hasPending);
+ row => row.hasPending);
}
}, {
name: 'previous-pending-room',
handler: () => {
this._moveSelectionFull(Gtk.DirectionType.UP,
- row => row.hasPending);
+ row => row.hasPending);
}
}];
actions.forEach(a => {
@@ -513,7 +515,7 @@ class RoomList extends Gtk.ListBox {
let toplevel = this.get_toplevel();
toplevel.connect('notify::active-room',
- this._activeRoomChanged.bind(this));
+ this._activeRoomChanged.bind(this));
this._activeRoomChanged();
}
diff --git a/src/roomManager.js b/src/roomManager.js
index 283268d..bc5f8c2 100644
--- a/src/roomManager.js
+++ b/src/roomManager.js
@@ -135,7 +135,7 @@ var RoomManager = class {
channel: new GLib.Variant('s', channelName)
});
this._settings.set_value('saved-channel-list',
- new GLib.Variant('aa{sv}', channels));
+ new GLib.Variant('aa{sv}', channels));
}
_removeSavedChannel(accountPath, channelName) {
@@ -145,7 +145,7 @@ var RoomManager = class {
return;
channels.splice(pos, 1);
this._settings.set_value('saved-channel-list',
- new GLib.Variant('aa{sv}', channels));
+ new GLib.Variant('aa{sv}', channels));
}
_removeSavedChannelsForAccount(accountPath) {
@@ -154,7 +154,7 @@ var RoomManager = class {
channels = channels.filter(c => !c.account.equal(account));
this._settings.set_value('saved-channel-list',
- new GLib.Variant('aa{sv}', channels));
+ new GLib.Variant('aa{sv}', channels));
}
_ensureRoom(accountPath, channelName, type, time) {
diff --git a/src/roomStack.js b/src/roomStack.js
index a9b180b..57e6540 100644
--- a/src/roomStack.js
+++ b/src/roomStack.js
@@ -50,9 +50,9 @@ var RoomStack = GObject.registerClass({
let toplevel = this.get_toplevel();
toplevel.connect('notify::active-room',
- this._activeRoomChanged.bind(this));
+ this._activeRoomChanged.bind(this));
toplevel.connect('active-room-state-changed',
- this._updateSensitivity.bind(this));
+ this._updateSensitivity.bind(this));
this._activeRoomChanged();
this._updateSensitivity();
}
@@ -200,8 +200,8 @@ class RoomView extends Gtk.Overlay {
box.add(this._entryArea);
this._view.bind_property('max-nick-chars',
- this._entryArea, 'max-nick-chars',
- GObject.BindingFlags.SYNC_CREATE);
+ this._entryArea, 'max-nick-chars',
+ GObject.BindingFlags.SYNC_CREATE);
sizeGroup.add_widget(this._entryArea);
this._view.connect('text-dropped', (view, text) => {
diff --git a/src/serverRoomManager.js b/src/serverRoomManager.js
index bf94c8b..2daf4aa 100644
--- a/src/serverRoomManager.js
+++ b/src/serverRoomManager.js
@@ -22,9 +22,9 @@ var ServerRoomManager = class {
this._accountsMonitor = AccountsMonitor.getDefault();
this._accountsMonitor.connect('account-status-changed',
- this._onAccountStatusChanged.bind(this));
+ this._onAccountStatusChanged.bind(this));
this._accountsMonitor.connect('account-removed',
- this._onAccountRemoved.bind(this));
+ this._onAccountRemoved.bind(this));
this._accountsMonitor.prepare(() => {
this._accountsMonitor.visibleAccounts.forEach(a => {
this._onAccountStatusChanged(this._accountsMonitor, a);
@@ -182,7 +182,7 @@ var ServerRoomList = GObject.registerClass({
this._manager = ServerRoomManager.getDefault();
let loadingChangedId =
this._manager.connect('loading-changed',
- this._onLoadingChanged.bind(this));
+ this._onLoadingChanged.bind(this));
this.connect('destroy', () => {
this.setAccount(null);
@@ -311,8 +311,9 @@ var ServerRoomList = GObject.registerClass({
let roomManager = RoomManager.getDefault();
this._idleId = GLib.idle_add(GLib.PRIORITY_DEFAULT_IDLE, () => {
- let customName = this._store.get_value(this._customRoomItem,
- RoomListColumn.NAME);
+ let customName = this._store.get_value(
+ this._customRoomItem,
+ RoomListColumn.NAME);
let store = this._store;
let startTime = GLib.get_monotonic_time();
while (this._pendingInfos.length > 0) {
@@ -324,7 +325,7 @@ var ServerRoomList = GObject.registerClass({
if (_strBaseEqual(name, customName)) {
store.set_value(this._customRoomItem,
- RoomListColumn.NAME, customName = '');
+ RoomListColumn.NAME, customName = '');
}
let room = roomManager.lookupRoomByName(roomInfo.get_name(), this._account);
@@ -334,8 +335,8 @@ var ServerRoomList = GObject.registerClass({
let { CHECKED, NAME, COUNT, SENSITIVE } = RoomListColumn;
let iter = store.insert_with_valuesv(-1,
- [CHECKED, NAME, COUNT, SENSITIVE],
- [checked, name, count, sensitive]);
+ [CHECKED, NAME, COUNT, SENSITIVE],
+ [checked, name, count, sensitive]);
store.move_before(iter, this._customRoomItem);
let maxTime = this._filterTerms.length > 0 ?
diff --git a/src/tabCompletion.js b/src/tabCompletion.js
index 437e809..e3481d9 100644
--- a/src/tabCompletion.js
+++ b/src/tabCompletion.js
@@ -67,8 +67,9 @@ var TabCompletion = class {
let allocation = this._entry.get_allocation();
let [ret_, x, y] = win.get_origin();
- x += allocation.x + Math.min((layoutX + wordPos.x) / Pango.SCALE,
- allocation.width - width);
+ x += allocation.x + Math.min(
+ (layoutX + wordPos.x) / Pango.SCALE,
+ allocation.width - width);
y += allocation.y - height;
this._popup.move(x, y);
this._popup.show();
diff --git a/src/telepathyClient.js b/src/telepathyClient.js
index ccd7a87..4b45f18 100644
--- a/src/telepathyClient.js
+++ b/src/telepathyClient.js
@@ -46,15 +46,16 @@ const SASLAbortReason = {
class SASLAuthHandler {
constructor(channel) {
this._channel = channel;
- this._proxy = new SASLAuthProxy(Gio.DBus.session,
- channel.bus_name,
- channel.object_path,
- this._onProxyReady.bind(this));
+ this._proxy = new SASLAuthProxy(
+ Gio.DBus.session,
+ channel.bus_name,
+ channel.object_path,
+ this._onProxyReady.bind(this));
}
_onProxyReady() {
this._proxy.connectSignal('SASLStatusChanged',
- this._onSASLStatusChanged.bind(this));
+ this._onSASLStatusChanged.bind(this));
let account = this._channel.connection.get_account();
Utils.lookupAccountPassword(account, this._onPasswordReady.bind(this));
@@ -62,12 +63,13 @@ class SASLAuthHandler {
_onPasswordReady(password) {
if (password) {
- this._proxy.StartMechanismWithDataRemote('X-TELEPATHY-PASSWORD',
- password);
+ this._proxy.StartMechanismWithDataRemote(
+ 'X-TELEPATHY-PASSWORD', password);
} else {
- this._proxy.AbortSASLRemote(SASLAbortReason.USER_ABORT,
- 'Password not available',
- this._resetPrompt.bind(this));
+ this._proxy.AbortSASLRemote(
+ SASLAbortReason.USER_ABORT,
+ 'Password not available',
+ this._resetPrompt.bind(this));
}
}
@@ -101,7 +103,7 @@ class SASLAuthHandler {
account.update_parameters_vardict_async(params, [], (a, res) => {
a.update_parameters_vardict_finish(res);
account.request_presence_async(Tp.ConnectionPresenceType.AVAILABLE,
- 'available', '', null);
+ 'available', '', null);
});
}
}
@@ -231,7 +233,7 @@ class TelepathyClient extends Tp.BaseClient {
this.register();
this._accountsMonitor.connect('account-status-changed',
- this._onAccountStatusChanged.bind(this));
+ this._onAccountStatusChanged.bind(this));
this._accountsMonitor.connect('account-added', (mon, account) => {
this._connectAccount(account);
});
@@ -243,10 +245,10 @@ class TelepathyClient extends Tp.BaseClient {
});
this._networkMonitor.connect('network-changed',
- this._onNetworkChanged.bind(this));
+ this._onNetworkChanged.bind(this));
if (this._networkMonitor.state_valid) {
this._onNetworkChanged(this._networkMonitor,
- this._networkMonitor.network_available);
+ this._networkMonitor.network_available);
}
}
@@ -562,9 +564,9 @@ class TelepathyClient extends Tp.BaseClient {
}
channel.connect('message-received',
- this._onMessageReceived.bind(this));
+ this._onMessageReceived.bind(this));
channel.connect('pending-message-removed',
- this._onPendingMessageRemoved.bind(this));
+ this._onPendingMessageRemoved.bind(this));
this._roomManager.ensureRoomForChannel(channel, 0);
});
@@ -644,8 +646,9 @@ class TelepathyClient extends Tp.BaseClient {
let text = _('Identification will happen automatically the next time you connect to
%s').format(accountName);
let notification = this._createNotification(room, summary, text);
- notification.add_button_with_target(_('Save'), 'app.save-identify-password',
- new GLib.Variant('o', accountPath));
+ notification.add_button_with_target(_('Save'),
+ 'app.save-identify-password',
+ new GLib.Variant('o', accountPath));
this._app.send_notification(this._getIdentifyNotificationID(accountPath), notification);
}
diff --git a/src/userList.js b/src/userList.js
index 1c61ef6..c928ca5 100644
--- a/src/userList.js
+++ b/src/userList.js
@@ -30,9 +30,9 @@ class UserListPopover extends Gtk.Popover {
let toplevel = this.get_toplevel();
toplevel.connect('notify::active-room',
- this._activeRoomChanged.bind(this));
+ this._activeRoomChanged.bind(this));
toplevel.connect('notify::view-height',
- this._updateContentHeight.bind(this));
+ this._updateContentHeight.bind(this));
}
_createWidget() {
@@ -45,7 +45,9 @@ class UserListPopover extends Gtk.Popover {
this._revealer = new Gtk.Revealer();
this._box.add(this._revealer);
- this._userListBin = new Gtk.Frame({ shadow_type: Gtk.ShadowType.NONE });
+ this._userListBin = new Gtk.Frame({
+ shadow_type: Gtk.ShadowType.NONE
+ });
this._box.add(this._userListBin);
this._entry = new Gtk.SearchEntry({
@@ -90,7 +92,7 @@ class UserListPopover extends Gtk.Popover {
this._userListBin.add(this._userList);
this._userList.vadjustment.connect('changed',
- this._updateEntryVisibility.bind(this));
+ this._updateEntryVisibility.bind(this));
this._updateEntryVisibility();
this._updateContentHeight();
}
@@ -147,7 +149,7 @@ var UserDetails = GObject.registerClass({
this.user = user;
this._messageButton.connect('clicked',
- this._onMessageButtonClicked.bind(this));
+ this._onMessageButtonClicked.bind(this));
this._updateButtonVisibility();
this._detailsGrid.hide();
@@ -184,7 +186,7 @@ var UserDetails = GObject.registerClass({
if (this._user) {
this._selfContactChangedId =
this._user.connection.connect('notify::self-contact',
- this._updateButtonVisibility.bind(this));
+ this._updateButtonVisibility.bind(this));
}
if (this.expanded)
@@ -231,8 +233,9 @@ var UserDetails = GObject.registerClass({
this._cancellable = new Gio.Cancellable();
if (this._user) {
- this._user.request_contact_info_async(this._cancellable,
- this._onContactInfoReady.bind(this));
+ this._user.request_contact_info_async(
+ this._cancellable,
+ this._onContactInfoReady.bind(this));
} else {
//TODO: else use this._nickname to query tracker
this._revealDetails();
@@ -249,37 +252,43 @@ var UserDetails = GObject.registerClass({
_formatLast(seconds) {
if (seconds < 60) {
- return ngettext('%d second ago',
- '%d seconds ago', seconds).format(seconds);
+ return ngettext(
+ '%d second ago',
+ '%d seconds ago', seconds).format(seconds);
}
let minutes = seconds / 60;
if (minutes < 60) {
- return ngettext('%d minute ago',
- '%d minutes ago', minutes).format(minutes);
+ return ngettext(
+ '%d minute ago',
+ '%d minutes ago', minutes).format(minutes);
}
let hours = minutes / 60;
if (hours < 24) {
- return ngettext('%d hour ago',
- '%d hours ago', hours).format(hours);
+ return ngettext(
+ '%d hour ago',
+ '%d hours ago', hours).format(hours);
}
let days = hours / 24;
if (days < 7) {
- return ngettext('%d day ago',
- '%d days ago', days).format(days);
+ return ngettext(
+ '%d day ago',
+ '%d days ago', days).format(days);
}
let weeks = days / 7;
if (days < 30) {
- return ngettext('%d week ago',
- '%d weeks ago', weeks).format(weeks);
+ return ngettext(
+ '%d week ago',
+ '%d weeks ago', weeks).format(weeks);
}
let months = days / 30;
- return ngettext('%d month ago',
- '%d months ago', months).format(months);
+ return ngettext(
+ '%d month ago',
+ '%d months ago', months).format(months);
}
_onContactInfoReady() {
@@ -405,17 +414,18 @@ var UserPopover = GObject.registerClass({
this._basenick = basenick;
- if (this._roomStatusChangedId > 0)
- this._userTracker.unwatchRoomStatus(this._room, this._roomStatusChangedId);
- this._roomStatusChangedId =
- this._userTracker.watchRoomStatus(this._room, this._basenick,
- this._onStatusChanged.bind(this));
+ if (this._roomStatusChangedId > 0) {
+ this._userTracker.unwatchRoomStatus(
+ this._room, this._roomStatusChangedId);
+ }
+ this._roomStatusChangedId = this._userTracker.watchRoomStatus(
+ this._room, this._basenick, this._onStatusChanged.bind(this));
if (this._globalStatusChangedId > 0)
this._userTracker.disconnect(this._globalStatusChangedId);
this._globalStatusChangedId =
this._userTracker.connect(`status-changed::${basenick}`,
- this._onStatusChanged.bind(this));
+ this._onStatusChanged.bind(this));
if (this._contactsChangedId > 0)
this._userTracker.disconnect(this._contactsChangedId);
@@ -434,8 +444,8 @@ var UserPopover = GObject.registerClass({
_onStatusChanged() {
let status = this._userTracker.getNickStatus(this._nickname);
- let roomStatus = this._userTracker.getNickRoomStatus(this._nickname,
- this._room);
+ let roomStatus = this._userTracker.getNickRoomStatus(
+ this._nickname, this._room);
let label;
if (status != roomStatus)
@@ -467,10 +477,10 @@ class UserListRow extends Gtk.ListBoxRow {
this._revealer.reveal_child = false;
});
this.connect('state-flags-changed',
- this._updateArrowVisibility.bind(this));
+ this._updateArrowVisibility.bind(this));
this._revealer.connect('notify::reveal-child',
- this._onExpandedChanged.bind(this));
+ this._onExpandedChanged.bind(this));
}
get user() {
@@ -549,8 +559,11 @@ class UserListRow extends Gtk.ListBoxRow {
this._label.label = this._user.alias;
} else {
let preMatch = this._user.alias.substring(0, filterIndex);
- let theMatch = this._user.alias.substring(filterIndex, filterIndex + this._filter.length);
- let postMatch = this._user.alias.substring(filterIndex + this._filter.length);
+ let theMatch = this._user.alias.substring(
+ filterIndex,
+ filterIndex + this._filter.length);
+ let postMatch = this._user.alias.substring(
+ filterIndex + this._filter.length);
this._label.label = `${preMatch}<b>${theMatch}<${'/'}b>${postMatch}`;
}
}
diff --git a/src/userTracker.js b/src/userTracker.js
index f5cbf08..428968c 100644
--- a/src/userTracker.js
+++ b/src/userTracker.js
@@ -18,9 +18,9 @@ var UserStatusMonitor = class {
this._accountsMonitor = AccountsMonitor.getDefault();
this._accountsMonitor.connect('account-added',
- this._onAccountAdded.bind(this));
+ this._onAccountAdded.bind(this));
this._accountsMonitor.connect('account-removed',
- this._onAccountRemoved.bind(this));
+ this._onAccountRemoved.bind(this));
this._accountsMonitor.accounts.forEach(a => {
this._onAccountAdded(this._accountsMonitor, a);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]