@@ -243,3 +243,36 @@ def test_transport_limit(acfactory) -> None:
243243
244244 # test that adding a transport after deleting one works again
245245 account .add_transport_from_qr (qr )
246+
247+
248+ def test_message_info_imap_urls (acfactory , log ) -> None :
249+ """Test that message info contains IMAP URLs of where the message was received."""
250+ alice , bob = acfactory .get_online_accounts (2 )
251+
252+ log .section ("Alice adds ac1 clone removes second transport" )
253+ qr = acfactory .get_account_qr ()
254+ for i in range (3 ):
255+ alice .add_transport_from_qr (qr )
256+ # Wait for all transports to go IDLE after adding each one.
257+ for _ in range (i + 1 ):
258+ alice .bring_online ()
259+
260+ new_alice_addr = alice .list_transports ()[2 ]["addr" ]
261+ alice .set_config ("configured_addr" , new_alice_addr )
262+
263+ # Enable multi-device mode so messages are not deleted immediately.
264+ alice .set_config ("bcc_self" , "1" )
265+
266+ # Bob creates chat, learning about Alice's currently selected transport.
267+ # This is where he will send the message.
268+ bob_chat = bob .create_chat (alice )
269+
270+ # Alice changes the transport again.
271+ alice .set_config ("configured_addr" , alice .list_transports ()[3 ]["addr" ])
272+
273+ bob_chat .send_text ("Hello!" )
274+
275+ msg = alice .wait_for_incoming_msg ()
276+ for alice_transport in alice .list_transports ():
277+ addr = alice_transport ["addr" ]
278+ assert (addr == new_alice_addr ) == (addr in msg .get_info ())
0 commit comments