From 79cfb2b93884a9261a4152e5936e45dd31170064 Mon Sep 17 00:00:00 2001 From: "Mr. Stallion" Date: Sat, 21 Mar 2020 13:35:22 -0500 Subject: [PATCH] Status message history --- chat/CharacterSearch.vue | 2 +- chat/ConversationView.vue | 2 +- chat/StatusPicker.vue | 111 ++++++++++++++++++++++++++++++++++++ chat/StatusSwitcher.vue | 36 +++++++++++- chat/interfaces.ts | 5 +- components/custom_dialog.ts | 2 +- electron/index.html | 2 +- readme.md | 17 +++--- 8 files changed, 162 insertions(+), 15 deletions(-) create mode 100644 chat/StatusPicker.vue diff --git a/chat/CharacterSearch.vue b/chat/CharacterSearch.vue index 745266a..74cc13a 100644 --- a/chat/CharacterSearch.vue +++ b/chat/CharacterSearch.vue @@ -286,7 +286,7 @@ .search-spinner { float: right; - animation: search-spin 4s linear infinite; + animation: search-spin 0.75s linear infinite; } } diff --git a/chat/ConversationView.vue b/chat/ConversationView.vue index 933d700..dde1e32 100644 --- a/chat/ConversationView.vue +++ b/chat/ConversationView.vue @@ -56,7 +56,7 @@ class="nav-link" href="#" @click.prevent="setMode(mode)">{{l('channel.mode.' + mode)}}
  • - Non-Matching
  • diff --git a/chat/StatusPicker.vue b/chat/StatusPicker.vue new file mode 100644 index 0000000..36bc7ed --- /dev/null +++ b/chat/StatusPicker.vue @@ -0,0 +1,111 @@ + + + + + diff --git a/chat/StatusSwitcher.vue b/chat/StatusSwitcher.vue index 19add28..4afabb1 100644 --- a/chat/StatusSwitcher.vue +++ b/chat/StatusSwitcher.vue @@ -17,6 +17,11 @@ +
    + +
    + + @@ -31,9 +36,11 @@ import {Character, userStatuses} from './interfaces'; import l from './localize'; import {getStatusIcon} from './UserView.vue'; + import StatusPicker from './StatusPicker.vue'; + import * as _ from 'lodash'; @Component({ - components: {modal: Modal, editor: Editor, dropdown: Dropdown} + components: {modal: Modal, editor: Editor, dropdown: Dropdown, 'status-picker': StatusPicker} }) export default class StatusSwitcher extends CustomDialog { selectedStatus: Character.Status | undefined; @@ -65,11 +72,36 @@ setStatus(): void { core.connection.send('STA', {status: this.status, statusmsg: this.text}); + + // tslint:disable-next-line + this.updateHistory(this.text); } reset(): void { this.selectedStatus = undefined; this.enteredText = undefined; } + + insertStatusMessage(statusMessage: string): void { + this.text = statusMessage; + } + + + async updateHistory(statusMessage: string): Promise { + if ((!statusMessage) || (statusMessage.trim() === '')) { + return; + } + + const curHistory: string[] = (await core.settingsStore.get('statusHistory')) || []; + const statusMessageClean = statusMessage.toString().trim().toLowerCase(); + const filteredHistory: string[] = _.reject(curHistory, (c: string) => (c.toString().trim().toLowerCase() === statusMessageClean)); + const newHistory: string[] = _.take(_.concat([statusMessage], filteredHistory), 10); + + await core.settingsStore.set('statusHistory', newHistory); + } + + showStatusPicker(): void { + (this.$refs['statusPicker']).show(); + } } - \ No newline at end of file + diff --git a/chat/interfaces.ts b/chat/interfaces.ts index 046e5dd..22f170f 100644 --- a/chat/interfaces.ts +++ b/chat/interfaces.ts @@ -145,13 +145,14 @@ export interface Logs { export namespace Settings { export type Keys = { - settings: Settings, - pinned: {channels: string[], private: string[]}, + settings: Settings + pinned: {channels: string[], private: string[]} conversationSettings: {[key: string]: Conversation.Settings | undefined} modes: {[key: string]: Channel.Mode | undefined} recent: Conversation.RecentPrivateConversation[] recentChannels: Conversation.RecentChannelConversation[] hiddenUsers: string[] + statusHistory: string[] }; export interface Store { diff --git a/components/custom_dialog.ts b/components/custom_dialog.ts index 971be27..a2b0248 100644 --- a/components/custom_dialog.ts +++ b/components/custom_dialog.ts @@ -17,4 +17,4 @@ export default class CustomDialog extends Vue { hide(): void { this.dialog.hide(); } -} \ No newline at end of file +} diff --git a/electron/index.html b/electron/index.html index 559538b..b5d7a50 100644 --- a/electron/index.html +++ b/electron/index.html @@ -12,4 +12,4 @@ - \ No newline at end of file + diff --git a/readme.md b/readme.md index 3c4d41f..6554894 100644 --- a/readme.md +++ b/readme.md @@ -7,10 +7,11 @@ This repository contains a heavily customized version of the mainline F-Chat 3.0 1. **Profile matching** automatically compares your profile with others to determine with whom you are compatible. 1. **Automatic ad posting** repeatedly posts and rotates ads on selected channels. -1. **Link previews** pop up shows a preview of an image when you hover your mouse over a link. +1. **Link previews** popup shows a preview of an image / video when you hover your mouse over a link. +1. **Caching** speeds up profile loads and other actions. -### More Details +### More Detailed Differences * Ads view * Highlight ads from characters most interesting to you @@ -42,10 +43,13 @@ This repository contains a heavily customized version of the mainline F-Chat 3.0 * Display match score in search results * Current search filters are listed in the search dialog * Search filters can be reset +* Character status + * Last 10 status messages are stored and can be accessed from the 'Set status' dialog * General - * Character profiles, guestbooks, friend lists, and image lists are cached for faster access. + * Character profiles, guestbooks, friend lists, and image lists are cached for faster access * Conversation dialog can be opened by typing in a character name - * Message search also checks character names + * Message search matches character names + * PM list shows characters' online status as a colored icon ## How to Set Up Ads @@ -76,10 +80,9 @@ This repository contains a heavily customized version of the mainline F-Chat 3.0 * Save character's status messages * Conversation bot API * 'Filter unmatching ads' is not channel specific -- it's either on everywhere or nowhere -* AD UI Cleanup / hide to popovers +* AD UI Cleanup / hide to popovers? * image loading animation -* Ad cache is broken -* Show online / offline status on PM list +* Usually submissive vs usually submissive shows up as 'maybe'? # F-List Exported