Version 2.13.x focuses on modernizing the core application codebase and providing new API features for developers.
ADC commands API
The new ADC commands allows developers to interact directly with the ADC protocol via hubs or directory with other clients over TCP or UDP protocol.
It’s possible to send ADC commands, read incoming ADC commands and add new parameters in outgoing commands. It’s also possible to advertise custom protocol supports to hubs/other clients so it’s fully possible to design and implement new ADC protocol extensions!
Example code
Here’s a very simplied version of an imaginary partial file sharing extension demonstrating a way to exchange information between the clients about finished files that aren’t shared yet. Note that there’s actual partial sharing functionality already implement in the client and it’s a lot more complicated than this.
Show code
// Add a support for our imaginary partial sharing extension (PSE0) that
// is advertised to other hub users in case we need it for other functionality
// It's not used in this example and in real use cases you shouldn't
// add supports "just in case" in order to save hub's bandwidth
await socket.post(`adc_commands/supports/hub/PSE0`)
await socket.addListener(
`search`,
'search_incoming_search',
async ({ results, query, user }) => {
if (!query.tth || results.length > 0) {
// No need to match text searches or if we have results already
return
}
// Check if we have something queued
const files = socket.post('queue', `files/${query.tth}`)
if (!files.length) {
return
}
// Send information about all queued files over UDP
for (const file of files) {
await socket.post(`adc_commands/udp_command`, {
command: {
type: 'U',
command: 'PSE',
params: [
`TH${file.tth}`,
]
},
user,
});
}
}
)
// Listener for incoming partial bundle sharing commands
// sent by other clients (PSE)
await socket.addListener(
`adc_commands`,
'incoming_udp_command/PSE',
async (commandData) => {
const tth = getAdcCommandParam(commandData, 'TH');
if (tth) {
// ...add source for the file or do something else
}
}
)
Changelog
Common
- Dupe detection is more accurate (new dupe types)
- Allow adding custom context menu items for sessions (hubs, private chats, filelists, viewed files)
- Add generic window-specific menu item contexts (events, queue, favorite hubs, share, transfers)
- Allow installed extensions to be disabled (no autostart)
Web Client 2.13.2
API
- New API module: ADC commands
- Share API: add endpoints for fetching share content information by real path (#438)
- Queue and Share APIs: add methods for getting files by TTH
- Hash API: add listeners for successfully hashed and failed files
- Share and filelist APIs: add hooks for filtering filelist directories/files and search results (#126)
- Search API: add listener for incoming searches
- Search API: add various new fields for user search results (non-grouped results)
- Hub API: Add ADC support fields for hubs and hub users
- Min and max size can now be set simultaneously for search queries
Core
- Ensure that the excluded directory always contains trailing slash
- Show spam rate when receiving CTM/search/incoming connection flood
- Fix possible issues with identical CIDs being generated for different clients
- Fix a crash when launching the app on the latest FreeBSD versions
- Various filelist-related bug and crash fixes
- Prevent adding duplicate search extensions for search types
- Idle (finished) download connections can now be forced
- Ensure that no duplicate search results are being sent
- Parse HBRI validation addresses received from the hub with the correct IP protocol
- Build: rewrite build scripts
- Other misc stability fixes
- Remove support for loading of legacy XML web server settings (the new format was added in Web Client 2.11.0)
- Partial file sharing is no longer available in NMDC hubs
- Fix setting of thread priorities
- Allow specifying a custom resource directory in dcppboot.xml, improve handling of relative paths
- Fix cases where the refreshing symbol was shown in the UI even after the refresh was completed
- Portable builds: fix debugging symbols
Web UI 2.13.0
- Allow cloning share profiles
- Fix adding of search types (#473)
- Fix bugs with loading/moving of Home layout widgets
- Change a few help URLs to use HTTPS
- Determine the UI height correctly on mobile devices (#483)
- Correct the help link for setting variables (#477)
- Fix various issues with the hinted user form field type in custom forms