19 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
5dfe0a5786 Added log levels 2015-06-07 19:03:04 +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
6afa417667 Added license 2015-06-01 00:38:11 +01:00
James Booth
123f23c438 Added http daemon 2015-05-31 23:17:50 +01:00
James Booth
e8ca581eea Added stbbr_wait_for 2015-05-30 22:43:28 +01:00
James Booth
7acf4f84e1 Renamed verification functions 2015-05-27 23:11:45 +01:00
James Booth
bb9b49a8ea Made verifications blocking calls with timeout 2015-05-27 22:41:51 +01:00
James Booth
dda02514df Added stbbr_send 2015-05-24 21:46:26 +01:00
James Booth
0d1ba9500c Added verify any 2015-05-24 19:23:38 +01:00
James Booth
d84e50bccd Added verify for last received stanza 2015-05-24 18:34:21 +01:00
James Booth
23cbdc9013 Handle shutdown 2015-05-24 00:55:39 +01:00
James Booth
5eb65540cf Removed stbbr_main 2015-05-17 15:55:42 +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
James Booth
1e327794e9 Renamed stabber function 2015-05-16 01:56:31 +01:00
James Booth
fe1f94cd93 Create shared library 2015-05-16 00:12:26 +01:00