Commit Graph

12 Commits

Author SHA1 Message Date
00f47a1598 fix: Fix XMPP stream parsing and add stbbr_for_presence_to helper (#1)
This PR fixes critical issues with XMPP stream parsing and adds a new helper function for MUC testing.

## Changes

### 1. Fix XMPP stream parsing for multiple stanzas
The XML parser was not correctly handling multiple consecutive stanzas in the stream. Fixed depth tracking to properly detect stanza boundaries.

### 2. Fix XMPP stream parsing depth tracking
Added proper depth tracking for nested XML elements to correctly identify when a complete stanza has been received.

### 3. Remove debug logging that interfered with expect tests
Removed verbose debug output that was causing expect-based functional tests to fail due to unexpected output in the stream.

### 4. Add `stbbr_for_presence_to` for MUC join presence matching
New helper function that registers a canned response for presence stanzas based on the `to` attribute. This is essential for testing MUC (Multi-User Chat) join flows where the response must be triggered by presence to a specific room JID.

**API:**
```c
void stbbr_for_presence_to(const char *to, const char *response);

Reviewed-on: jabber.developer2/stabber#1
Co-authored-by: jabber.developer2 <jabber.developer2@jabber.space>
Co-committed-by: jabber.developer2 <jabber.developer2@jabber.space>
2025-12-15 08:45:38 +00:00
James Booth
ddd1bf99a4 Moved stanza data structures 2015-06-06 22:37:50 +01:00
James Booth
6522e94977 Renamed stanza -> stanzas 2015-06-06 22:22:18 +01:00
James Booth
fe36df4dbe Allow stubbing based on query xmlns 2015-06-02 00:19:53 +01:00
James Booth
ddb837cdcd Renamed stbbr_for -> stbbr_for_id 2015-06-01 22:02:18 +01:00
James Booth
32db648cfb Added prime for id to http api 2015-06-01 19:50:50 +01:00
James Booth
6afa417667 Added license 2015-06-01 00:38:11 +01:00
James Booth
c6fb212a74 Free primes 2015-05-18 00:33:24 +01:00
James Booth
27f44c01ff Moved thread creation 2015-05-17 15:24:03 +01:00
James Booth
94d1f1e84d Renamed stanza->stream for id callback 2015-05-16 22:31:36 +01:00
James Booth
ede3ccab9d Added id handler 2015-05-16 21:55:51 +01:00
James Booth
50cd28a977 Added password primer 2015-05-16 03:03:24 +01:00