Skip to content

feature: Add XMPP JID support with utilities and exception handling - #14

Merged
XenoSnowFox merged 5 commits into
mainfrom
feature/rfc-7622-xmpp-address-format
Aug 22, 2026
Merged

feature: Add XMPP JID support with utilities and exception handling#14
XenoSnowFox merged 5 commits into
mainfrom
feature/rfc-7622-xmpp-address-format

Conversation

@XenoSnowFox

Copy link
Copy Markdown
Contributor

No description provided.

Add the RFC 7622 specification text documenting the XMPP JID address format, including domain, localpart, and resourcepart rules, normalization requirements, security considerations, and conformance guidance. This captures the updated internationalized address standard that supersedes the older stringprep-based format.
Introduce include/xtrpg/utils/String.hpp providing small, header-only string helpers in namespace xtrpg::utils::string: in-place ltrim/rtrim/trim, in-place toLowerCase (uses unsigned char -> std::tolower), and countUtf8CodePoints (counts UTF-8 code points by skipping continuation bytes). These utilities are intended for common string preprocessing tasks.
Adds xtrpg::xmpp::exception::MalformedJid, an invalid_argument subtype for malformed XMPP JIDs. It includes a default 'Malformed JID' message and an overload that accepts a custom error message for callers that need more context.
Introduce xtrpg::xmpp::Jid with parsing and construction from full or component JIDs. Provides accessors (local/domain/resource), bare/full conversions, comparison operators, ostream output, and a std::hash specialization for unordered_map keys. Parsing trims input, lowercases local/domain, enforces UTF-8 codepoint limits, and throws exception::MalformedJid on invalid input. Uses xtrpg::utils::string helpers.
This commit introduces a dedicated xtrpg_xmpp static library for XMPP/JID support and links it into the main server executable. It also renames the config target section for clarity and adds the MSVC UTF-8 compile flag so source strings are emitted correctly in the server binary.
@XenoSnowFox
XenoSnowFox merged commit d4cae37 into main Aug 22, 2026
4 checks passed
@XenoSnowFox
XenoSnowFox deleted the feature/rfc-7622-xmpp-address-format branch August 22, 2026 02:34
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