Commit graph

29 commits

Author SHA1 Message Date
e7d31e41dc Expect: add description alongside callback
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2022-09-22 18:40:50 +02:00
562aadb488
Room: simplify add_session; abstract away send_subject
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2022-09-18 14:07:53 +02:00
44bec0e232
Add test_presence_resync
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2022-09-18 12:12:27 +02:00
c884f38dc2
Add broadcast_presence method
Also add bits of the next commit because there are too many changes now
and I failed to properly dissociate with add -p :(

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2022-09-18 11:45:04 +02:00
7554ff4d7c
component: add TestElement to have a custom Debug for Element
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2022-09-17 22:17:26 +02:00
ef03c1b032
Return SessionAlreadyExists error in Occupant::add_session
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2022-09-17 16:53:33 +02:00
307a888a0b
DateTime::from_utc isn't being merged in parsers
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2022-09-17 16:31:12 +02:00
3935d68d7e
error/MismatchJids: take both jids
So it's possible to see directly which jids are conflicting

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2022-09-17 16:23:53 +02:00
92ca50abc7
Add README.md and LICENSE
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2022-09-12 23:06:15 +02:00
2f35111210
Broadcast new occupant presence to existing occupants
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2022-09-12 00:53:29 +02:00
769939be0a handlers: cargo fmt
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2022-09-12 00:52:33 +02:00
43c31ed1c3 TestComponent: Split expect_with into _iq, _message, _presence
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2022-09-12 00:52:33 +02:00
d383aa8655 We can now leave rooms!
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2022-09-12 00:48:04 +02:00
b7ee30c3f7
Add test for joining an existing room
- Send affiliation/role in occupant presence. Always the same for now.
- Send one presence per occupant (might changer again later on)
- Store subject in Room. Store participant/date alongside subject

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2022-09-12 00:22:36 +02:00
d1d7aea45b
tests: remove _0045 in fn name
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2022-09-11 13:11:14 +02:00
29b952a726
tests: ensure occupants count is correct
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2022-09-11 13:10:09 +02:00
afd1f23ac3
Add test_0045_join_presence_nick_already_assigned
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2022-09-11 13:10:01 +02:00
f86ca3fa66
TestComponent: Unqueue from the front. This isn't a stack
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2022-09-11 13:08:12 +02:00
ab9f824dec
component: impl Debug for Expect
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2022-09-11 13:07:38 +02:00
35e323f448
Rename types module to room
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2022-09-10 18:37:15 +02:00
0282a8905c
Change pub(crate) into pub
Modules aren't publicly exported anyway so it should be about the same.

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2022-09-10 18:33:57 +02:00
7797af95b9
Add TestComponent.expect_with; test for Delay in MUC subject
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2022-09-10 18:00:02 +02:00
8fececd97f
test_0045_join_presence_empty_room: ensure room is created
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2022-09-10 12:43:34 +02:00
b29ac6b274
add test_0045_join_presence_empty_room
Remove static ROOMS, pass it down to handlers

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2022-09-10 12:38:42 +02:00
88828da67e
New ComponentTrait for testing
Move handlers in their own module. Add a component module for the
Component newtype and TestComponent. Add a tests component.

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2022-09-10 10:36:56 +02:00
6019772e64
Remove iter_mut impl on Occupant
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2022-09-08 00:26:56 +02:00
ca068ba243
split types
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2022-09-08 00:26:08 +02:00
f77b6e5583
split error code
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2022-09-07 23:55:54 +02:00
05033ee6f7
Initial commit: Users can join!
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2022-09-07 20:08:27 +02:00