@@ -80,7 +80,7 @@ received_handler_spec() ->
8080
8181- spec ttd (exml :element (), escalus_connection :metadata ()) -> non_neg_integer ().
8282ttd (Stanza , #{recv_timestamp := ReceivedTS }) ->
83- SentBin = exml_query :path (Stanza , [{element , <<" body " >>}, cdata ]),
83+ SentBin = exml_query :path (Stanza , [{element , <<" timestamp " >>}, cdata ]),
8484 ReceivedTS - binary_to_integer (SentBin ).
8585
8686- spec is_muc_notification (exml :element ()) -> boolean ().
@@ -106,7 +106,9 @@ is_muc_message(_) -> false.
106106- spec send_message_to_room (escalus :client (), binary ()) -> ok .
107107send_message_to_room (Client , RoomJid ) ->
108108 Timestamp = integer_to_binary (os :system_time (microsecond )),
109- escalus :send (Client , escalus_stanza :groupchat_to (RoomJid , Timestamp )).
109+ Message = # xmlel {children = Children } = escalus_stanza :groupchat_to (RoomJid , cfg (message_body )),
110+ TimestampElement = # xmlel {name = <<" timestamp" >>, children = [# xmlcdata {content = Timestamp }]},
111+ escalus :send (Client , Message # xmlel {children = [TimestampElement | Children ]}).
110112
111113% %% MUC Light: Room creation
112114
0 commit comments