Skip to content

Refactor/mirc script split#71

Merged
ggielly merged 6 commits into
devfrom
refactor/mirc-script-split
Jun 19, 2026
Merged

Refactor/mirc script split#71
ggielly merged 6 commits into
devfrom
refactor/mirc-script-split

Conversation

@ggielly

@ggielly ggielly commented Jun 19, 2026

Copy link
Copy Markdown
Owner

Modularize and enhance the mIRC script (fish_11.mrc) for better maintainability, fix bugs, and add missing features.

Key Changes

Modularization (10 modules)

  • Split monolithic 2293-line fish_11.mrc into focused modules
  • Created scripts/mirc/modules/ directory with independent .mrc files
  • Main loader script loads all modules in dependency order

Bug fixes

  • Enable FiSH11_SetMircDir call at startup (was commented out)
  • Initialize %fish_config_file properly in startup
  • Fix timer uniqueness for key exchange (per-contact labels)
  • Fix fish11_remove_channel_key to safely ignore DLL return
  • Fix INI_SetString vs INI_SetInt mismatch for boolean config values

New features

  • Incoming message decryption fallback handlers (TEXT, NOTICE, ACTION)
  • FCEP-1 channel encryption support in outgoing messages
  • Key TTL display (/fish11_keyttl command and /fish11_showkey integration)
  • Manual decryption command (/fish11_decrypt_msg or /fdec)

Code quality

  • All comments standardized to English
  • Unused variables removed
  • Helper aliases made local (alias -l)
  • Section headers added to all modules

Files changed

  • scripts/mirc/fish_11.mrc - Main loader (26 lines now w00t!)
  • scripts/mirc/modules/fish11_startup.mrc - DLL loading
  • scripts/mirc/modules/fish11_key_management.mrc - Key operations
  • scripts/mirc/modules/fish11_key_exchange.mrc - X25519 protocol
  • scripts/mirc/modules/fish11_encrypt_out.mrc - Outgoing encryption
  • scripts/mirc/modules/fish11_encrypt_in.mrc - Incoming decryption
  • scripts/mirc/modules/fish11_channel.mrc - FCEP-1, channel keys
  • scripts/mirc/modules/fish11_masterkey.mrc - Master key management
  • scripts/mirc/modules/fish11_legacy.mrc - FiSH 10 compatibility
  • scripts/mirc/modules/fish11_menus.mrc - All mIRC menus
  • scripts/mirc/modules/fish11_utils.mrc - Helpers, debug, backup

ggielly added 6 commits June 19, 2026 13:31
- Removed LogKey and associated functionality from the core key management module.
- Updated key system initialization to exclude log key handling.
- Removed log key derivation functions from the key derivation module.
- Eliminated log encryption and decryption functions from the DLL interface.
- Updated logging module to remove file-based logging and encryption logic.
- Refactored logger initialization to utilize the core logging system.
- Cleaned up Mirc script to remove encrypted logging commands and aliases.
- Adjusted documentation to reflect changes in key management and logging.
- Split monolithic 2293-line fish_11.mrc into modular files
- Create fish11_startup.mrc for DLL loading and initialization
- Create fish11_key_management.mrc for key operations
- Create fish11_key_exchange.mrc for X25519 protocol
- Create fish11_encrypt_out.mrc for outgoing encryption
- Create fish11_encrypt_in.mrc placeholder for incoming decryption
- Create fish11_channel.mrc for FCEP-1 and channel keys
- Create fish11_masterkey.mrc for master key management
- Create fish11_legacy.mrc for FiSH 10 compatibility
- Create fish11_menus.mrc for all mIRC menus
- Create fish11_utils.mrc for helpers, debug, and utilities

Bug fixes:
- Enable FiSH11_SetMircDir call at startup (was commented out)
- Initialize %fish_config_file properly in startup
- Fix timer uniqueness for key exchange (per-contact labels)
- Fix fish11_remove_channel_key to safely ignore DLL return
- Fix INI_SetString vs INI_SetInt mismatch for boolean config values
- Add fish11_SetIniIntValue helper for integer/boolean settings
- Translate French comments to English
- Remove unused variables
Implement fallback decryption handlers for incoming encrypted messages
when fish_11_inject.dll is not loaded:

- Add fish11_try_decrypt_incoming() helper for private messages
- Add fish11_try_decrypt_channel() helper for channel messages
- Add handlers for TEXT, NOTICE, and ACTION events
- Support both FiSH 11 (ChaCha20-Poly1305) and FiSH 10 (Blowfish)
- Add manual decryption command: /fish11_decrypt_msg (shorthand: /fdec)
- Update help text with incoming decryption information

The inject DLL handles most decryption transparently via SSL hooking.
These handlers provide a fallback for cases where the inject DLL
is not loaded or for manual decryption purposes.
Features added:
- FCEP-1 channel encryption in outgoing messages (B.5)
  * Outgoing encryption now detects channel targets (# or &)
  * Automatically uses FiSH11_EncryptMsg for channel keys (manual or FCEP-1)
  * Falls back to legacy Blowfish for private messages with legacy keys

- Key TTL display (B.6)
  * Add /fish11_keyttl <nickname> command (shorthand: /fkeyttl)
  * Shows remaining lifetime of exchange keys (24-hour TTL)
  * Displays EXPIRED, NO_TTL, or time remaining in hours/minutes

Bug fixes:
- Fix backup/restore functionality (B.4)
  * FiSH11_BackupKeys/RestoreKeys not yet implemented in DLL
  * Updated backup menu to show placeholder message
  * Removed broken DLL calls that would fail silently

- Update help text with new commands
- Remove duplicate var %keys declaration in fish11_file_list_keys
- Remove unused %x variable in fish11_debug (use noop instead)
- Remove unused %delkey variable in fish11_debug (use noop instead)
- Make fish11_display_multiline_result a local alias (alias -l)
- All section headers verified present in all modules
- All French comments already translated to English
- Show key TTL (expiration) in fish11_showkey window display
- Add fish_keyttl11 shortcut alias for fish11_keyttl
- Show EXPIRED, NO_TTL, or time remaining when viewing keys
- Window size increased to accommodate TTL info
@ggielly ggielly self-assigned this Jun 19, 2026
@ggielly ggielly merged commit 3e432c8 into dev Jun 19, 2026
1 check passed
@ggielly ggielly deleted the refactor/mirc-script-split branch June 19, 2026 15:13
@ggielly ggielly restored the refactor/mirc-script-split branch June 19, 2026 15:29
@ggielly ggielly deleted the refactor/mirc-script-split branch June 19, 2026 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant