serverless-ircd 0.6.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/ci.yml +6 -1
- package/.gitmodules +3 -0
- package/CHANGELOG.md +214 -0
- package/README.md +110 -23
- package/apps/aws-stack/package.json +1 -1
- package/apps/cf-tcp-container/package.json +1 -1
- package/apps/cf-worker/package.json +1 -1
- package/apps/cf-worker/src/origin-allowlist.ts +99 -0
- package/apps/cf-worker/src/worker.ts +89 -9
- package/apps/cf-worker/tests/fixtures/web-dist/app/index.html +18 -0
- package/apps/cf-worker/tests/fixtures/web-dist/index.html +18 -0
- package/apps/cf-worker/tests/origin-allowlist.test.ts +101 -0
- package/apps/cf-worker/tests/smoke.test.ts +28 -2
- package/apps/cf-worker/tests/ws-origin.test.ts +89 -0
- package/apps/cf-worker/wrangler.test.toml +23 -0
- package/apps/cf-worker/wrangler.toml +54 -0
- package/apps/local-cli/package.json +1 -1
- package/apps/web/landing/index.html +217 -0
- package/apps/web/package.json +28 -0
- package/apps/web/scripts/build.mjs +125 -0
- package/apps/web/src/build-env.ts +43 -0
- package/apps/web/src/config-schema.ts +138 -0
- package/apps/web/static/config.json +28 -0
- package/apps/web/static/config.prod.json +28 -0
- package/apps/web/static/config.staging.json +28 -0
- package/apps/web/tests/build-env.test.ts +63 -0
- package/apps/web/tests/build-smoke.test.ts +103 -0
- package/apps/web/tests/config-schema.test.ts +432 -0
- package/apps/web/tests/workspace.test.ts +12 -0
- package/apps/web/tsconfig.json +10 -0
- package/apps/web/upstream/.browserslistrc +3 -0
- package/apps/web/upstream/.editorconfig +9 -0
- package/apps/web/upstream/.eslintignore +3 -0
- package/apps/web/upstream/.eslintrc.js +90 -0
- package/apps/web/upstream/.github/FUNDING.yml +12 -0
- package/apps/web/upstream/.github/ISSUE_TEMPLATE/bug_report.md +38 -0
- package/apps/web/upstream/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
- package/apps/web/upstream/.github/workflows/push.yml +26 -0
- package/apps/web/upstream/.github/workflows/release.yml +33 -0
- package/apps/web/upstream/.github/workflows/release_manual.yml +55 -0
- package/apps/web/upstream/.prettierrc.js +9 -0
- package/apps/web/upstream/.stylelintignore +5 -0
- package/apps/web/upstream/.stylelintrc.js +21 -0
- package/apps/web/upstream/LICENSE +201 -0
- package/apps/web/upstream/README.md +76 -0
- package/apps/web/upstream/babel.config.js +25 -0
- package/apps/web/upstream/crowdin.yml +3 -0
- package/apps/web/upstream/index.html +35 -0
- package/apps/web/upstream/jest.config.js +7 -0
- package/apps/web/upstream/jsdoc.json +22 -0
- package/apps/web/upstream/package.json +80 -0
- package/apps/web/upstream/scripts/pre-commit +43 -0
- package/apps/web/upstream/src/components/App.vue +516 -0
- package/apps/web/upstream/src/components/AppSettings.vue +587 -0
- package/apps/web/upstream/src/components/AutoComplete.vue +284 -0
- package/apps/web/upstream/src/components/Avatar.vue +105 -0
- package/apps/web/upstream/src/components/AwayStatusIndicator.vue +77 -0
- package/apps/web/upstream/src/components/BufferKey.vue +121 -0
- package/apps/web/upstream/src/components/BufferSettings.vue +97 -0
- package/apps/web/upstream/src/components/Captcha.vue +85 -0
- package/apps/web/upstream/src/components/ChannelBanlist.vue +96 -0
- package/apps/web/upstream/src/components/ChannelInfo.vue +159 -0
- package/apps/web/upstream/src/components/ChannelInvitelist.vue +276 -0
- package/apps/web/upstream/src/components/ChannelList.vue +345 -0
- package/apps/web/upstream/src/components/Container.vue +401 -0
- package/apps/web/upstream/src/components/ContainerHeader.vue +522 -0
- package/apps/web/upstream/src/components/ControlInput.vue +1016 -0
- package/apps/web/upstream/src/components/LoadingAnimation.vue +104 -0
- package/apps/web/upstream/src/components/MediaViewer.vue +199 -0
- package/apps/web/upstream/src/components/MessageInfo.vue +192 -0
- package/apps/web/upstream/src/components/MessageList.vue +1028 -0
- package/apps/web/upstream/src/components/MessageListAvatar.vue +20 -0
- package/apps/web/upstream/src/components/MessageListMessageCompact.vue +361 -0
- package/apps/web/upstream/src/components/MessageListMessageInline.vue +257 -0
- package/apps/web/upstream/src/components/MessageListMessageModern.vue +430 -0
- package/apps/web/upstream/src/components/NetworkSettings.vue +528 -0
- package/apps/web/upstream/src/components/Nicklist.vue +309 -0
- package/apps/web/upstream/src/components/NicklistUser.vue +181 -0
- package/apps/web/upstream/src/components/NotConnected.vue +271 -0
- package/apps/web/upstream/src/components/SelfUser.vue +283 -0
- package/apps/web/upstream/src/components/ServerSelector.vue +162 -0
- package/apps/web/upstream/src/components/ServerView.vue +126 -0
- package/apps/web/upstream/src/components/SettingsAdvanced.vue +232 -0
- package/apps/web/upstream/src/components/SettingsAliases.vue +121 -0
- package/apps/web/upstream/src/components/Sidebar.vue +429 -0
- package/apps/web/upstream/src/components/SidebarAboutBuffer.vue +288 -0
- package/apps/web/upstream/src/components/SidebarState.vue +145 -0
- package/apps/web/upstream/src/components/StartupError.vue +35 -0
- package/apps/web/upstream/src/components/StateBrowser.vue +420 -0
- package/apps/web/upstream/src/components/StateBrowserBuffer.vue +124 -0
- package/apps/web/upstream/src/components/StateBrowserNetwork.vue +823 -0
- package/apps/web/upstream/src/components/StateBrowserUsermenu.vue +162 -0
- package/apps/web/upstream/src/components/TypingStatusIndicator.vue +34 -0
- package/apps/web/upstream/src/components/TypingUsersList.vue +56 -0
- package/apps/web/upstream/src/components/UrlEmbed.vue +149 -0
- package/apps/web/upstream/src/components/UserBox.vue +728 -0
- package/apps/web/upstream/src/components/inputtools/Emoji.vue +67 -0
- package/apps/web/upstream/src/components/inputtools/TextStyle.vue +142 -0
- package/apps/web/upstream/src/components/startups/CommonLayout.vue +208 -0
- package/apps/web/upstream/src/components/startups/CustomServer.vue +495 -0
- package/apps/web/upstream/src/components/startups/KiwiBnc.vue +361 -0
- package/apps/web/upstream/src/components/startups/Personal.vue +317 -0
- package/apps/web/upstream/src/components/startups/Welcome.vue +544 -0
- package/apps/web/upstream/src/components/startups/ZncLogin.vue +229 -0
- package/apps/web/upstream/src/components/utils/InputConfirm.vue +68 -0
- package/apps/web/upstream/src/components/utils/InputPrompt.vue +118 -0
- package/apps/web/upstream/src/components/utils/InputText.vue +172 -0
- package/apps/web/upstream/src/components/utils/IrcInput.vue +579 -0
- package/apps/web/upstream/src/components/utils/PluginWrapper.vue +26 -0
- package/apps/web/upstream/src/components/utils/TabbedView.vue +149 -0
- package/apps/web/upstream/src/components/utils/TransitionExpand.vue +97 -0
- package/apps/web/upstream/src/helpers/Colours.js +128 -0
- package/apps/web/upstream/src/helpers/IrcdDiffs.js +26 -0
- package/apps/web/upstream/src/helpers/Md5.js +193 -0
- package/apps/web/upstream/src/helpers/Misc.js +401 -0
- package/apps/web/upstream/src/helpers/TextFormatting.js +237 -0
- package/apps/web/upstream/src/libs/AliasRewriter.js +157 -0
- package/apps/web/upstream/src/libs/AudioManager.js +60 -0
- package/apps/web/upstream/src/libs/BouncerMiddleware.js +247 -0
- package/apps/web/upstream/src/libs/BouncerProvider.js +551 -0
- package/apps/web/upstream/src/libs/ChathistoryMiddleware.js +153 -0
- package/apps/web/upstream/src/libs/ConfigLoader.js +94 -0
- package/apps/web/upstream/src/libs/EmojiProvider.js +46 -0
- package/apps/web/upstream/src/libs/GlobalApi.js +346 -0
- package/apps/web/upstream/src/libs/IPC.js +51 -0
- package/apps/web/upstream/src/libs/InputHandler.js +921 -0
- package/apps/web/upstream/src/libs/IrcClient.js +1506 -0
- package/apps/web/upstream/src/libs/Logger.js +71 -0
- package/apps/web/upstream/src/libs/Message.js +169 -0
- package/apps/web/upstream/src/libs/MessageFormatter.js +364 -0
- package/apps/web/upstream/src/libs/MessageParser.js +249 -0
- package/apps/web/upstream/src/libs/Notifications.js +78 -0
- package/apps/web/upstream/src/libs/ServerConnection.js +270 -0
- package/apps/web/upstream/src/libs/ServerSession.js +102 -0
- package/apps/web/upstream/src/libs/SoundBleep.js +20 -0
- package/apps/web/upstream/src/libs/StatePersistence.js +90 -0
- package/apps/web/upstream/src/libs/ThemeManager.js +128 -0
- package/apps/web/upstream/src/libs/TypingMiddleware.js +105 -0
- package/apps/web/upstream/src/libs/WindowTitle.js +63 -0
- package/apps/web/upstream/src/libs/batchedAdd.js +74 -0
- package/apps/web/upstream/src/libs/bufferTools.js +177 -0
- package/apps/web/upstream/src/libs/polyfill/Element.closest.js +18 -0
- package/apps/web/upstream/src/libs/renderers/Html.js +113 -0
- package/apps/web/upstream/src/libs/settingTools.js +31 -0
- package/apps/web/upstream/src/libs/state/BufferState.js +703 -0
- package/apps/web/upstream/src/libs/state/NetworkState.js +158 -0
- package/apps/web/upstream/src/libs/state/UserState.js +89 -0
- package/apps/web/upstream/src/libs/state/common.js +26 -0
- package/apps/web/upstream/src/libs/state.js +961 -0
- package/apps/web/upstream/src/libs/storage/Local.js +51 -0
- package/apps/web/upstream/src/main.js +566 -0
- package/apps/web/upstream/src/res/autocompleteCommands.js +31 -0
- package/apps/web/upstream/src/res/configTemplates.js +373 -0
- package/apps/web/upstream/src/res/globalStyle.css +277 -0
- package/apps/web/upstream/src/res/kiwiLoadingLogo.png +0 -0
- package/apps/web/upstream/src/res/locales/app.af-ZA.po +1145 -0
- package/apps/web/upstream/src/res/locales/app.ar-SA.po +1145 -0
- package/apps/web/upstream/src/res/locales/app.bg-BG.po +1145 -0
- package/apps/web/upstream/src/res/locales/app.bs-BA.po +1145 -0
- package/apps/web/upstream/src/res/locales/app.ca-ES.po +1145 -0
- package/apps/web/upstream/src/res/locales/app.cs-CZ.po +1145 -0
- package/apps/web/upstream/src/res/locales/app.da-DK.po +1145 -0
- package/apps/web/upstream/src/res/locales/app.de-DE.po +1145 -0
- package/apps/web/upstream/src/res/locales/app.dev.po +1246 -0
- package/apps/web/upstream/src/res/locales/app.el-GR.po +1145 -0
- package/apps/web/upstream/src/res/locales/app.en-US.po +1145 -0
- package/apps/web/upstream/src/res/locales/app.es-419.po +1145 -0
- package/apps/web/upstream/src/res/locales/app.es-AR.po +1145 -0
- package/apps/web/upstream/src/res/locales/app.es-EM.po +536 -0
- package/apps/web/upstream/src/res/locales/app.es-ES.po +1145 -0
- package/apps/web/upstream/src/res/locales/app.es-US.po +1145 -0
- package/apps/web/upstream/src/res/locales/app.eu-ES.po +1145 -0
- package/apps/web/upstream/src/res/locales/app.fi-FI.po +1145 -0
- package/apps/web/upstream/src/res/locales/app.fr-FR.po +1145 -0
- package/apps/web/upstream/src/res/locales/app.gl-ES.po +1145 -0
- package/apps/web/upstream/src/res/locales/app.he-IL.po +1145 -0
- package/apps/web/upstream/src/res/locales/app.hi-IN.po +1145 -0
- package/apps/web/upstream/src/res/locales/app.hu-HU.po +1145 -0
- package/apps/web/upstream/src/res/locales/app.id-ID.po +1145 -0
- package/apps/web/upstream/src/res/locales/app.it-IT.po +1145 -0
- package/apps/web/upstream/src/res/locales/app.ja-JP.po +1145 -0
- package/apps/web/upstream/src/res/locales/app.ko-KR.po +1145 -0
- package/apps/web/upstream/src/res/locales/app.nl-NL.po +1145 -0
- package/apps/web/upstream/src/res/locales/app.no-NO.po +1145 -0
- package/apps/web/upstream/src/res/locales/app.pl-PL.po +1145 -0
- package/apps/web/upstream/src/res/locales/app.pt-BR.po +1145 -0
- package/apps/web/upstream/src/res/locales/app.pt-PT.po +1145 -0
- package/apps/web/upstream/src/res/locales/app.ro-RO.po +1145 -0
- package/apps/web/upstream/src/res/locales/app.ru-RU.po +1145 -0
- package/apps/web/upstream/src/res/locales/app.sl-SI.po +1145 -0
- package/apps/web/upstream/src/res/locales/app.sq-AL.po +1145 -0
- package/apps/web/upstream/src/res/locales/app.sr-SP.po +1145 -0
- package/apps/web/upstream/src/res/locales/app.sv-SE.po +1145 -0
- package/apps/web/upstream/src/res/locales/app.tr-TR.po +1145 -0
- package/apps/web/upstream/src/res/locales/app.uk-UA.po +1145 -0
- package/apps/web/upstream/src/res/locales/app.vi-VN.po +1145 -0
- package/apps/web/upstream/src/res/locales/app.zh-CN.po +1145 -0
- package/apps/web/upstream/src/res/locales/app.zh-TW.po +1145 -0
- package/apps/web/upstream/src/res/localesList.json +27 -0
- package/apps/web/upstream/src/res/logo.png +0 -0
- package/apps/web/upstream/src/thirdparty/about.html +43 -0
- package/apps/web/upstream/src/thirdparty/index.js +5 -0
- package/apps/web/upstream/src/thirdparty/kiwiirccom.vue +185 -0
- package/apps/web/upstream/static/config.json +28 -0
- package/apps/web/upstream/static/emoticons/smile.png +0 -0
- package/apps/web/upstream/static/favicon.png +0 -0
- package/apps/web/upstream/static/highlight.mp3 +0 -0
- package/apps/web/upstream/static/highlight.ogg +0 -0
- package/apps/web/upstream/static/locales/.gitignore +2 -0
- package/apps/web/upstream/static/plugins/customise.html.example +10 -0
- package/apps/web/upstream/static/themes/coffee/theme.css +145 -0
- package/apps/web/upstream/static/themes/common/base.css +1064 -0
- package/apps/web/upstream/static/themes/dark/theme.css +196 -0
- package/apps/web/upstream/static/themes/default/theme.css +92 -0
- package/apps/web/upstream/static/themes/elite/theme.css +248 -0
- package/apps/web/upstream/static/themes/grayfox/theme.css +143 -0
- package/apps/web/upstream/static/themes/nightswatch/theme.css +367 -0
- package/apps/web/upstream/static/themes/osprey/theme.css +115 -0
- package/apps/web/upstream/static/themes/radioactive/theme.css +1211 -0
- package/apps/web/upstream/static/themes/sky/theme.css +107 -0
- package/apps/web/upstream/tests/unit/BatchAdd.spec.js +174 -0
- package/apps/web/upstream/tests/unit/MessageParser.spec.js +125 -0
- package/apps/web/upstream/tests/unit/Misc.spec.js +24 -0
- package/apps/web/upstream/tests/unit/NetworkState.spec.js +58 -0
- package/apps/web/upstream/tests/unit/StartupError.spec.js +20 -0
- package/apps/web/upstream/vue.config.js +150 -0
- package/apps/web/upstream/yarn.lock +9767 -0
- package/apps/web/vitest.config.ts +13 -0
- package/biome.json +1 -0
- package/docs/Home.md +1 -0
- package/docs/WebClientGuide.md +535 -0
- package/package.json +2 -2
- package/packages/aws-adapter/package.json +1 -1
- package/packages/cf-adapter/package.json +1 -1
- package/packages/cf-adapter/tests/cf-harness.ts +12 -1
- package/packages/in-memory-runtime/package.json +1 -1
- package/packages/irc-core/package.json +1 -1
- package/packages/irc-core/reports/mutation/mutation.html +342 -0
- package/packages/irc-core/tests/batch.test.ts +15 -0
- package/packages/irc-core/tests/numerics.test.ts +13 -0
- package/packages/irc-core/tests/parser.test.ts +109 -0
- package/packages/irc-server/package.json +1 -1
- package/packages/irc-test-support/package.json +1 -1
- package/packages/irc-test-support/src/scenarios.ts +24 -2
- package/tools/ci-hardening/package.json +1 -1
- package/tools/load-test/package.json +1 -1
- package/tools/tcp-ws-forwarder/package.json +1 -1
|
@@ -0,0 +1,309 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
:class="{
|
|
4
|
+
'kiwi-nicklist--filtering': filter_visible,
|
|
5
|
+
'kiwi-nicklist--avatars': shouldShowAvatars,
|
|
6
|
+
}"
|
|
7
|
+
class="kiwi-nicklist"
|
|
8
|
+
>
|
|
9
|
+
<div class="kiwi-nicklist-usercount" @click="toggleUserFilter">
|
|
10
|
+
<span>
|
|
11
|
+
{{
|
|
12
|
+
filter_visible ?
|
|
13
|
+
sortedUsers.length :
|
|
14
|
+
$t('person', {count: sortedUsers.length})
|
|
15
|
+
}}
|
|
16
|
+
</span>
|
|
17
|
+
|
|
18
|
+
<input
|
|
19
|
+
ref="user_filter"
|
|
20
|
+
v-model="user_filter"
|
|
21
|
+
:placeholder="$t('filter_users')"
|
|
22
|
+
@blur="onFilterBlur"
|
|
23
|
+
>
|
|
24
|
+
<i class="fa fa-search" />
|
|
25
|
+
</div>
|
|
26
|
+
|
|
27
|
+
<DynamicScroller
|
|
28
|
+
:items="sortedUsers"
|
|
29
|
+
:min-item-size="34"
|
|
30
|
+
:key-field="'key'"
|
|
31
|
+
class="kiwi-nicklist-users"
|
|
32
|
+
>
|
|
33
|
+
<template #default="{ item, index, active }">
|
|
34
|
+
<DynamicScrollerItem
|
|
35
|
+
:item="item"
|
|
36
|
+
:active="active"
|
|
37
|
+
:size-dependencies="[]"
|
|
38
|
+
:data-index="index"
|
|
39
|
+
>
|
|
40
|
+
<nicklist-user
|
|
41
|
+
:key="item.key"
|
|
42
|
+
:user="item"
|
|
43
|
+
:nicklist="self"
|
|
44
|
+
:network="network"
|
|
45
|
+
/>
|
|
46
|
+
</DynamicScrollerItem>
|
|
47
|
+
</template>
|
|
48
|
+
</DynamicScroller>
|
|
49
|
+
</div>
|
|
50
|
+
</template>
|
|
51
|
+
|
|
52
|
+
<script>
|
|
53
|
+
|
|
54
|
+
'kiwi public';
|
|
55
|
+
|
|
56
|
+
import Logger from '@/libs/Logger';
|
|
57
|
+
import * as Misc from '@/helpers/Misc';
|
|
58
|
+
|
|
59
|
+
import NicklistUser from './NicklistUser';
|
|
60
|
+
|
|
61
|
+
let log = Logger.namespace('Nicklist');
|
|
62
|
+
|
|
63
|
+
export default {
|
|
64
|
+
components: {
|
|
65
|
+
NicklistUser,
|
|
66
|
+
},
|
|
67
|
+
props: ['network', 'buffer', 'sidebarState'],
|
|
68
|
+
data: function data() {
|
|
69
|
+
return {
|
|
70
|
+
userbox_user: null,
|
|
71
|
+
user_filter: '',
|
|
72
|
+
filter_visible: false,
|
|
73
|
+
self: this,
|
|
74
|
+
};
|
|
75
|
+
},
|
|
76
|
+
computed: {
|
|
77
|
+
shouldShowAvatars() {
|
|
78
|
+
return this.buffer.setting('nicklist_avatars');
|
|
79
|
+
},
|
|
80
|
+
sortedUsers() {
|
|
81
|
+
// Get a list of network prefixes and give them a rank number
|
|
82
|
+
let netPrefixes = this.network.ircClient.network.options.PREFIX;
|
|
83
|
+
let prefixOrders = Object.create(null);
|
|
84
|
+
netPrefixes.forEach((prefix, idx) => {
|
|
85
|
+
prefixOrders[prefix.mode] = idx;
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
// A few things here:
|
|
89
|
+
// * Since vuejs will sort in-place and update views when .sort is called
|
|
90
|
+
// on an array, clone it first so that we have a plain array to sort
|
|
91
|
+
// * Keep a map of uppercase nicks to we don't need to call .toUpperCase()
|
|
92
|
+
// on each one all the time. This is a hot function!
|
|
93
|
+
let nickMap = Object.create(null);
|
|
94
|
+
let users = [];
|
|
95
|
+
let bufferUsers = this.buffer.users;
|
|
96
|
+
let nickFilter = this.user_filter.toUpperCase();
|
|
97
|
+
|
|
98
|
+
Object.entries(bufferUsers).forEach(([uppercaseNick, user]) => {
|
|
99
|
+
nickMap[user.nick] = uppercaseNick;
|
|
100
|
+
if (!nickFilter || uppercaseNick.indexOf(nickFilter) !== -1) {
|
|
101
|
+
users.push(user);
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
let bufferId = this.buffer.id;
|
|
106
|
+
return users.sort((a, b) => {
|
|
107
|
+
let bufferA = a.buffers[bufferId];
|
|
108
|
+
let bufferB = b.buffers[bufferId];
|
|
109
|
+
|
|
110
|
+
if (!bufferA) {
|
|
111
|
+
let msg = 'Nicklist.sortedUsers() User A does not have the buffer in its list!';
|
|
112
|
+
log.error(msg, a.nick, a.buffers);
|
|
113
|
+
return -1;
|
|
114
|
+
}
|
|
115
|
+
if (!bufferB) {
|
|
116
|
+
let msg = 'Nicklist.sortedUsers() User B does not have the buffer in its list!';
|
|
117
|
+
log.error(msg, b.nick, b.buffers);
|
|
118
|
+
return 1;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
let modesA = bufferA.modes;
|
|
122
|
+
let modesB = bufferB.modes;
|
|
123
|
+
|
|
124
|
+
// Neither user has a prefix, compare text
|
|
125
|
+
if (
|
|
126
|
+
modesA.length === 0 &&
|
|
127
|
+
modesB.length === 0
|
|
128
|
+
) {
|
|
129
|
+
// Compare away status
|
|
130
|
+
if (this.$state.setting('nicklistGroupAway')) {
|
|
131
|
+
if (a.away && !b.away) {
|
|
132
|
+
return 1;
|
|
133
|
+
}
|
|
134
|
+
if (!a.away && b.away) {
|
|
135
|
+
return -1;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
return Misc.strCompare(nickMap[a.nick], nickMap[b.nick]);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
// Compare via prefixes..
|
|
143
|
+
if (
|
|
144
|
+
modesA.length > 0 &&
|
|
145
|
+
modesB.length === 0
|
|
146
|
+
) {
|
|
147
|
+
return -1;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
if (
|
|
151
|
+
modesA.length === 0 &&
|
|
152
|
+
modesB.length > 0
|
|
153
|
+
) {
|
|
154
|
+
return 1;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
// Both users have a prefix so find the highest ranking one
|
|
158
|
+
let aP = prefixOrders[this.buffer.userMode(a)];
|
|
159
|
+
let bP = prefixOrders[this.buffer.userMode(b)];
|
|
160
|
+
if (aP > bP) {
|
|
161
|
+
return 1;
|
|
162
|
+
} else if (aP < bP) {
|
|
163
|
+
return -1;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
// Prefixes are the same, compare away status
|
|
167
|
+
if (this.$state.setting('nicklistGroupAway')) {
|
|
168
|
+
if (a.away && !b.away) {
|
|
169
|
+
return 1;
|
|
170
|
+
}
|
|
171
|
+
if (!a.away && b.away) {
|
|
172
|
+
return -1;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
// Prefixes are the same, resort to comparing text
|
|
177
|
+
return Misc.strCompare(nickMap[a.nick], nickMap[b.nick]);
|
|
178
|
+
});
|
|
179
|
+
},
|
|
180
|
+
useColouredNicks() {
|
|
181
|
+
return this.buffer.setting('coloured_nicklist');
|
|
182
|
+
},
|
|
183
|
+
},
|
|
184
|
+
methods: {
|
|
185
|
+
userModePrefix(user) {
|
|
186
|
+
return this.buffer.userModePrefix(user);
|
|
187
|
+
},
|
|
188
|
+
userMode(user) {
|
|
189
|
+
return this.buffer.userMode(user);
|
|
190
|
+
},
|
|
191
|
+
openQuery(user) {
|
|
192
|
+
let buffer = this.$state.addBuffer(this.buffer.networkid, user.nick);
|
|
193
|
+
this.$state.setActiveBuffer(buffer.networkid, buffer.name);
|
|
194
|
+
if (this.$state.ui.is_narrow) {
|
|
195
|
+
this.sidebarState.close();
|
|
196
|
+
}
|
|
197
|
+
},
|
|
198
|
+
openUserbox(user) {
|
|
199
|
+
this.$state.$emit('userbox.show', user, {
|
|
200
|
+
buffer: this.buffer,
|
|
201
|
+
});
|
|
202
|
+
},
|
|
203
|
+
toggleUserFilter() {
|
|
204
|
+
this.filter_visible = !this.filter_visible;
|
|
205
|
+
if (this.filter_visible) {
|
|
206
|
+
this.$nextTick(() => this.$refs.user_filter.focus());
|
|
207
|
+
} else {
|
|
208
|
+
this.user_filter = '';
|
|
209
|
+
}
|
|
210
|
+
},
|
|
211
|
+
onFilterBlur() {
|
|
212
|
+
if (!this.user_filter) {
|
|
213
|
+
this.filter_visible = false;
|
|
214
|
+
}
|
|
215
|
+
},
|
|
216
|
+
},
|
|
217
|
+
};
|
|
218
|
+
</script>
|
|
219
|
+
|
|
220
|
+
<style lang="less">
|
|
221
|
+
|
|
222
|
+
/* Adjust the sidebars width when this nicklist is in view */
|
|
223
|
+
.kiwi-container .kiwi-sidebar.kiwi-sidebar-section-nicklist {
|
|
224
|
+
max-width: 250px;
|
|
225
|
+
width: 250px;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
.kiwi-nicklist {
|
|
229
|
+
overflow: hidden;
|
|
230
|
+
box-sizing: border-box;
|
|
231
|
+
min-height: 100px;
|
|
232
|
+
margin: auto;
|
|
233
|
+
width: 100%;
|
|
234
|
+
//Padding bottom is needed, otherwise the scrollbar will show on the right side.
|
|
235
|
+
padding-bottom: 1px;
|
|
236
|
+
height: 100%;
|
|
237
|
+
display: flex;
|
|
238
|
+
flex-direction: column;
|
|
239
|
+
align-items: flex-start;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
.kiwi-nicklist-usercount {
|
|
243
|
+
display: flex;
|
|
244
|
+
justify-content: space-between;
|
|
245
|
+
cursor: default;
|
|
246
|
+
box-sizing: border-box;
|
|
247
|
+
height: 43px;
|
|
248
|
+
line-height: 40px;
|
|
249
|
+
width: 100%;
|
|
250
|
+
border-bottom: 1px solid;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
.kiwi-nicklist-usercount span {
|
|
254
|
+
margin-left: 15px;
|
|
255
|
+
font-weight: 600;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
.kiwi-nicklist-usercount .fa-search {
|
|
259
|
+
opacity: 0.3;
|
|
260
|
+
cursor: pointer;
|
|
261
|
+
font-size: 1.2em;
|
|
262
|
+
line-height: 40px;
|
|
263
|
+
align-self: flex-start;
|
|
264
|
+
margin-right: 15px;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
.kiwi-nicklist-usercount .fa-search:hover,
|
|
268
|
+
.kiwi-nicklist--filtering .kiwi-nicklist-usercount .fa-search {
|
|
269
|
+
opacity: 1;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
.kiwi-nicklist-usercount input {
|
|
273
|
+
width: 0%;
|
|
274
|
+
border: none;
|
|
275
|
+
font-weight: normal;
|
|
276
|
+
background: none;
|
|
277
|
+
outline: 0;
|
|
278
|
+
padding: 0 15px 0 10px;
|
|
279
|
+
opacity: 0;
|
|
280
|
+
box-sizing: border-box;
|
|
281
|
+
flex-grow: 1;
|
|
282
|
+
transition: all 0.2s;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
.kiwi-nicklist--filtering .kiwi-nicklist-usercount input {
|
|
286
|
+
opacity: 1;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
.kiwi-nicklist-users {
|
|
290
|
+
width: 100%;
|
|
291
|
+
padding: 0;
|
|
292
|
+
margin: 0;
|
|
293
|
+
overflow-y: scroll;
|
|
294
|
+
overflow-x: hidden;
|
|
295
|
+
box-sizing: border-box;
|
|
296
|
+
max-height: 100%;
|
|
297
|
+
flex: 1 auto;
|
|
298
|
+
line-height: 1.2em;
|
|
299
|
+
margin-top: 6px;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
@media screen and (max-width: 759px) {
|
|
303
|
+
.kiwi-container .kiwi-sidebar.kiwi-sidebar-section-nicklist {
|
|
304
|
+
width: 100%;
|
|
305
|
+
max-width: 380px;
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
</style>
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
<template functional>
|
|
2
|
+
<div
|
|
3
|
+
:class="[
|
|
4
|
+
props.nicklist.userMode(props.user) ?
|
|
5
|
+
'kiwi-nicklist-user--mode-' + props.nicklist.userMode(props.user) :
|
|
6
|
+
'',
|
|
7
|
+
props.user.away ? 'kiwi-nicklist-user--away' : '',
|
|
8
|
+
props.user.ignore ? 'kiwi-nicklist-user--ignore' : '',
|
|
9
|
+
data.staticClass,
|
|
10
|
+
]"
|
|
11
|
+
:data-nick="(props.user.nick||'').toLowerCase()"
|
|
12
|
+
class="kiwi-nicklist-user"
|
|
13
|
+
@click="props.nicklist.openUserbox(props.user)"
|
|
14
|
+
>
|
|
15
|
+
<div v-if="props.m().shouldShowAvatars()" class="kiwi-avatar-container">
|
|
16
|
+
<component
|
|
17
|
+
:is="injections.components.Avatar"
|
|
18
|
+
v-if="props.user"
|
|
19
|
+
:user="props.user"
|
|
20
|
+
size="small"
|
|
21
|
+
/>
|
|
22
|
+
<component
|
|
23
|
+
:is="injections.components.AwayStatusIndicator"
|
|
24
|
+
:network="props.network"
|
|
25
|
+
:user="props.user"
|
|
26
|
+
:toggle="false"
|
|
27
|
+
/>
|
|
28
|
+
</div>
|
|
29
|
+
<div v-else>
|
|
30
|
+
<component
|
|
31
|
+
:is="injections.components.AwayStatusIndicator"
|
|
32
|
+
:network="props.network"
|
|
33
|
+
:user="props.user"
|
|
34
|
+
:toggle="false"
|
|
35
|
+
/>
|
|
36
|
+
</div>
|
|
37
|
+
<span class="kiwi-nicklist-user-prefix">
|
|
38
|
+
{{ props.nicklist.userModePrefix(props.user) }}
|
|
39
|
+
</span><span
|
|
40
|
+
:style="{ 'color': props.m().userColour() }"
|
|
41
|
+
class="kiwi-nicklist-user-nick"
|
|
42
|
+
>{{ props.user.nick }}
|
|
43
|
+
</span>
|
|
44
|
+
<span class="kiwi-nicklist-messageuser" @click.stop="props.nicklist.openQuery(props.user)">
|
|
45
|
+
<i class="fa fa-comment" aria-hidden="true" />
|
|
46
|
+
</span>
|
|
47
|
+
<component
|
|
48
|
+
:is="injections.components.TypingStatusIndicator"
|
|
49
|
+
:user="props.user"
|
|
50
|
+
:buffer="props.nicklist.buffer"
|
|
51
|
+
/>
|
|
52
|
+
</div>
|
|
53
|
+
</template>
|
|
54
|
+
|
|
55
|
+
<script>
|
|
56
|
+
'kiwi public';
|
|
57
|
+
|
|
58
|
+
import AwayStatusIndicator from './AwayStatusIndicator';
|
|
59
|
+
import TypingStatusIndicator from './TypingStatusIndicator';
|
|
60
|
+
import Avatar from './Avatar';
|
|
61
|
+
|
|
62
|
+
const methods = {
|
|
63
|
+
props: {},
|
|
64
|
+
userColour() {
|
|
65
|
+
let props = this.props;
|
|
66
|
+
if (props.nicklist.useColouredNicks) {
|
|
67
|
+
return props.user.getColour();
|
|
68
|
+
}
|
|
69
|
+
return '';
|
|
70
|
+
},
|
|
71
|
+
shouldShowAvatars() {
|
|
72
|
+
let props = this.props;
|
|
73
|
+
return props.nicklist.buffer.setting('nicklist_avatars');
|
|
74
|
+
},
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
export default {
|
|
78
|
+
inject: {
|
|
79
|
+
components: {
|
|
80
|
+
default: {
|
|
81
|
+
AwayStatusIndicator,
|
|
82
|
+
TypingStatusIndicator,
|
|
83
|
+
Avatar,
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
props: {
|
|
88
|
+
network: Object,
|
|
89
|
+
user: Object,
|
|
90
|
+
nicklist: Object,
|
|
91
|
+
m: {
|
|
92
|
+
default: function m() {
|
|
93
|
+
// vue uses this function to generate the prop. `this`==null Return our own function
|
|
94
|
+
return function n() {
|
|
95
|
+
// Give our methods some props context before its function is called.
|
|
96
|
+
// This is only safe because the function on the methods object is called on
|
|
97
|
+
// the same js tick
|
|
98
|
+
methods.props = this;
|
|
99
|
+
return methods;
|
|
100
|
+
};
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
};
|
|
105
|
+
</script>
|
|
106
|
+
|
|
107
|
+
<style>
|
|
108
|
+
|
|
109
|
+
.kiwi-nicklist-user {
|
|
110
|
+
line-height: 26px;
|
|
111
|
+
padding: 0 12px 0 12px;
|
|
112
|
+
border-left: 4px solid;
|
|
113
|
+
margin: 0 0 0 0;
|
|
114
|
+
position: relative;
|
|
115
|
+
box-sizing: border-box;
|
|
116
|
+
transition: all 0.1s;
|
|
117
|
+
cursor: pointer;
|
|
118
|
+
white-space: nowrap;
|
|
119
|
+
display: flex;
|
|
120
|
+
align-items: center;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.kiwi-nicklist--avatars .kiwi-nicklist-user {
|
|
124
|
+
line-height: 32px;
|
|
125
|
+
padding-bottom: 6px;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.kiwi-nicklist-user-nick {
|
|
129
|
+
font-weight: bold;
|
|
130
|
+
cursor: pointer;
|
|
131
|
+
display: block;
|
|
132
|
+
width: 100%;
|
|
133
|
+
padding-right: 20px;
|
|
134
|
+
overflow: hidden;
|
|
135
|
+
text-overflow: ellipsis;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.kiwi-nicklist-messageuser {
|
|
139
|
+
position: absolute;
|
|
140
|
+
content: '\f075';
|
|
141
|
+
right: -1em;
|
|
142
|
+
font-family: fontAwesome, sans-serif;
|
|
143
|
+
line-height: 26px;
|
|
144
|
+
opacity: 0;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.kiwi-nicklist-messageuser:hover {
|
|
148
|
+
cursor: pointer;
|
|
149
|
+
transition: all 0.2s;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.kiwi-nicklist-user:hover .kiwi-nicklist-messageuser {
|
|
153
|
+
opacity: 1;
|
|
154
|
+
right: 1em;
|
|
155
|
+
transition: all 0.2s;
|
|
156
|
+
transition-delay: 0.1s;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.kiwi-avatar-container {
|
|
160
|
+
position: relative;
|
|
161
|
+
margin-right: 10px;
|
|
162
|
+
flex: 0;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.kiwi-avatar-container .kiwi-avatar {
|
|
166
|
+
width: 30px;
|
|
167
|
+
height: 30px;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.kiwi-avatar-container .kiwi-awaystatusindicator {
|
|
171
|
+
position: absolute;
|
|
172
|
+
top: 0;
|
|
173
|
+
right: 0;
|
|
174
|
+
margin: 0;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.kiwi-avatar-container-user-prefix {
|
|
178
|
+
flex: 0;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
</style>
|