Skip to content

Commit

Permalink
feat: autocomplete online friends only
Browse files Browse the repository at this point in the history
  • Loading branch information
feildmaster committed Nov 1, 2020
1 parent 3b47cc4 commit e3e7fdf
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
5 changes: 4 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
# UnderScript Changelog

## Version 0.42.0 (2020-10-31)
## Version 0.42.0 (2020-11-01)
### New Features
1. Added setting to ignore pings from closed chats
1. Opponent now shows on autocomplete
1. Added external projects to Undercards Menu
1. Added option to only show online friends in autocomplete
### Fixes
1. Fixed user turn not showing in battle log
1. Fixed streamer mode chat errors
1. Fixed online friends not updating (thanks Onu)

## Version 0.41.2 (2020-10-15)
1. Fixed Token not working in Craft page (again)
Expand Down
7 changes: 7 additions & 0 deletions src/base/chat/autocomplete.friends.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
wrap(() => {
const setting = settings.register({
name: 'Autocomplete: Online Friends Only',
key: 'underscript.autocomplete.friends.online',
page: 'Chat',
});

eventManager.on('@autocomplete', ({ list }) => {
list.splice(0, 0, ...global('selfFriends')
.filter(({ online }) => !setting.value() || online)
.map(fn.user.name)
.filter((name) => !list.includes(name)));
});
Expand Down

0 comments on commit e3e7fdf

Please sign in to comment.