# Description
Fixes notifications so that they always trigger when the chat is not
open, fixes a possible exploit where a user can send a message that is
longer than the max message length, and improves the UX of NanoChat in a
few areas.
Original message from
https://github.com/Goob-Station/Goob-Station/pull/1313:
> Fixed NanoChat message notifications not showing up in situations
where you'd definitely expect them to occur.
>
> Now, for a chat to not send a notification upon a new message, three
conditions need to be fulfilled:
> - You don't have the chat muted
> - Your PDA UI is open
> - You have NanoChat as your open program
> - Your currently-selected chat is the aforementioned chat
More changes:
- Validate NanoChat message length & chat name/job title length on the
server
c063001ca9.
-If they are too long, they will be truncated to the maximum length.
- Improve the UI for editing a chat:
- Added a proper icon (used to be the letter E) for the Edit Chat
button.

- The Edit Chat popup now has correct text: the title is now "Edit a
contact", not "Add a new chat" and the Create button has been renamed to
the Confirm button.

- Editing a chat no longer deselects the current chat.
- This is done by adding a new NanoChatUiMessageType entry, `EditChat`
and a new server-side handler function just for chat edits. The previous
edit chat method simply *deleted* the chat from the client and created a
new one.
- Form validation is now more robust: you can now only submit the edit
if you've made changes to the name or job title.
- Fixed NanoChat not appearing in PDAs with more than 5 pre-installed
programs by increasing the PDA disk space (max program count) from 5 to
8, the current disk space in Wizden.

- The job title now appears on the notification title.

- The title will be truncated if it's too long.

- Improved form validation on the New Chat popup by only allowing users
to submit if the Number field is 4 numbers long. Previously, inputs like
"0" "12" "289" were valid which is ultimately incorrect as phone numbers
function more like strings that just happen to be digit-only and less
like actual numbers.

- The left chat list will now truncate names and job titles if they're
too long.

## Changelog
🆑 Skubman
- add: NanoChat message notifications will now show you the job title of
the sender alongside their name.
- add: The NanoChat edit button now has a proper icon.
- tweak: The disk space (max amount of installable programs) on PDAs has
been increased from 5 to 8. This also fixes a bug where NanoChat was not
being installed on PDAs with more than 5 pre-installed cartridges.
- tweak: The character limit for names and job titles in NanoChat has
been increased to their actual limit on ID cards (30 characters).
- tweak: NanoChat chat list names/titles and notification titles that
are too long will be shortened, indicated with "..." at the end.
- tweak: The NanoChat edit popup now displays the correct text, instead
of appearing identical to the new chat popup.
- fix: NanoChat will now send a new message notification no matter what
if you don't have the chat open.
- fix: Editing a chat in NanoChat no longer deselects that chat.
- fix: Fixed a issue where users could potentially send NanoChat
messages longer than the maximum allowed message length.
- fix: Fixed being able to create a new chat when you haven't typed in 4
digits in the number field.
(cherry picked from commit f11d2e7976491a5c95aeb36eaa7a313624197a88)
# Description
Due to some inherent limitations of maintenance, code review, and me
having both severely crippling ADHD and a lifelong adderal dependency,
I've made the executive decision to break apart the Psionic Refactor
into a multitude of smaller, bite sized PRs. I'm keeping the original
Psionic Refactor PR open, because I'm going to need it for code
reference to keep track of the changes I had originally worked on, but I
need to essentially restart the entire refactor from scratch, and
approach it from a new angle that's going to make everything actually
way easier. I also need to be able to work on each available system
individually wherever possible, and this fact is most readily shown by
how the Lightning Refactor and Oracle Refactor were both done
separately.
To start off, this PR is ONLY moving all of the relevant psionics code
to core folders, and nothing more. I'm doing this first so that I can
immediately cut down massively on the "Files Changed" with the simplest,
most basic change necessary to start my work.
No changelog because this isn't player facing, and no media because
there's literally nothing to show.
* Use new Subs.CVar helper
Removes manual config OnValueChanged calls, removes need to remember to manually unsubscribe.
This both reduces boilerplate and fixes many issues where subscriptions weren't removed on entity system shutdown.
* Fix a bunch of warnings
* More warning fixes
* Use new DateTime serializer to get rid of ISerializationHooks in changelog code.
* Get rid of some more ISerializationHooks for enums
* And a little more
* Apply suggestions from code review
Co-authored-by: 0x6273 <0x40@keemail.me>
---------
Co-authored-by: 0x6273 <0x40@keemail.me>
(cherry picked from commit 68ce53ae17985876d6d112b764b2144964a9f42e)
* Add Console, PDA news tab, and ringstone popup
* Add English localization
* Add mass-media console board to Advanced Entertainment resrarch
* Fix misprint
* Deleting unused libraries
* Fix round restart problem
* Fixing restart problem
* Just another fix
* Сode optimization
* Code optimization
* Convert News read tab to cartridge
Convert the News read tab into a cartridge, and fix a couple of bugs
* Just another fix
* Some updates
* More fixing!!
Fix cooldown, add author label to read menu
* Again, fix cooldown bug
* Some minor changes
* Revert "Some minor changes"
This reverts commit 470c8d727629ac79994f70e56162adae8659e944.
* Some minor updates
* Implement NetProbeCartridge
* Add audio and a popup when scanning a device
Add some doc comments
* Set program icon
* Add NetProbe cartridge as rare loot to maintenance loot tool spawner
* Make the maximum amount of saved entries configurable
Add a scrollbar that shows when there are more entries than fit on the screen
* Make device net id names translatable
* Work on cartridges
* Work on PDA UI
* Work on PDA UIs program list
* Work on PDA UI borders
* Add DeviceNetworkingComponent to the pda base prototype
* Fix submodule version
* Fix cartridge loader ui key
* Fix pda menu xaml
* Implement relaying ui messages
* Finish implementing the notekeeper cartridge
* Fix submodule version
* Fix errors from merging master
* Fix test failing
* Implement setting preinstalled programs
* Add some documentation to CartridgeLoaderSystem
* Add more doc comments
* Add localization to program names
* Implement review suggestions
* Fix background programs receiving events twice when active