dappros / ethora

A 'super app' engine for your project. React Native (iOS, Android) and React.js (Web, desktop). Social Sign In 🄵, Messaging 💬 (chat, voice, push notifications), Web3 Wallet 🪪 (profile QR, documents, coins, NFT), DLT 🔐 (provenance, crypto signing), Gamification 🤩, Social Commerce and more.
https://ethora.com/
GNU Affero General Public License v3.0
441 stars 90 forks source link

mod_edit - Clientside update #512

Closed dzinzyura closed 1 year ago

dzinzyura commented 1 year ago

Goal: Introduce the updated mod_edit logic on the clientside.

Affected metric:

Description: Make changes on the clientside to handle the new format of the mod_edit module.

Message example from the history <message xmlns="jabber:client" to="[u1@dev.dxmpp.com](mailto:u1@dev.dxmpp.com)/130811407860302170711138" from="[wend@conference.dev.dxmpp.com](mailto:wend@conference.dev.dxmpp.com)"><result id="1696317314425072" xmlns="urn:xmpp:mam:2"><forwarded xmlns="urn:xmpp:forward:0"><message xml:lang="en" from="[wend@conference.dev.dxmpp.com](mailto:wend@conference.dev.dxmpp.com)/u1" type="groupchat" id="sendMessage" xmlns="jabber:client"><x xmlns="http://jabber.org/protocol/muc#user"><item jid="[u1@dev.dxmpp.com](mailto:u1@dev.dxmpp.com)/130811407860302170711138"/></x><archived by="[wend@conference.dev.dxmpp.com](mailto:wend@conference.dev.dxmpp.com)" id="1696317314425072" xmlns="urn:xmpp:mam:tmp"/><stanza-id by="[wend@conference.dev.dxmpp.com](mailto:wend@conference.dev.dxmpp.com)" id="1696317314425072" xmlns="urn:xmpp:sid:0"/><data xmlns="wss://dev.dxmpp.com:5443/ws" senderFirstName="bob" senderLastName="bob" mucName="mucName" inProd="true" msgType="message" push="true"/><body>first message</body></message><delay from="[conference.dev.dxmpp.com](http://conference.dev.dxmpp.com/)" stamp="2023-10-03T07:15:14.425072Z" xmlns="urn:xmpp:delay"/></forwarded></result></message>

For editing, the following xml request is sent <message id="replaceMessage" type="groupchat" to="[wend@conference.dev.dxmpp.com](mailto:wend@conference.dev.dxmpp.com)"><replace id="1696317314425072" xmlns="urn:xmpp:message-correct:0" text="first message edited now"/></message>

The replace.id here is the id of the message we are editing replace.text - the text you want to replace with

For online users there will be such xml <message xmlns="jabber:client" xml:lang="en" to="[u1@dev.dxmpp.com](mailto:u1@dev.dxmpp.com)/130811407860302170711138" from="[wend@conference.dev.dxmpp.com](mailto:wend@conference.dev.dxmpp.com)/u1" type="groupchat" id="replaceMessage"><replace xmlns="urn:xmpp:message-correct:0" id="1696317314425072" text="first message edited now"/></message>

For users, who'll receive messages from the history <message xmlns="jabber:client" to="[u1@dev.dxmpp.com](mailto:u1@dev.dxmpp.com)/130811407860302170711138" from="[wend@conference.dev.dxmpp.com](mailto:wend@conference.dev.dxmpp.com)"><result id="1696317314425072" xmlns="urn:xmpp:mam:2"><forwarded xmlns="urn:xmpp:forward:0"><message xml:lang="en" from="[wend@conference.dev.dxmpp.com](mailto:wend@conference.dev.dxmpp.com)/u1" type="groupchat" id="sendMessage" xmlns="jabber:client"><x xmlns="http://jabber.org/protocol/muc#user"><item jid="[u1@dev.dxmpp.com](mailto:u1@dev.dxmpp.com)/130811407860302170711138"/></x><archived by="[wend@conference.dev.dxmpp.com](mailto:wend@conference.dev.dxmpp.com)" id="1696317314425072" xmlns="urn:xmpp:mam:tmp"/><stanza-id by="[wend@conference.dev.dxmpp.com](mailto:wend@conference.dev.dxmpp.com)" id="1696317314425072" xmlns="urn:xmpp:sid:0"/><replaced timestamp="1696317486494538"/><data xmlns="wss://dev.dxmpp.com:5443/ws" senderFirstName="bob" senderLastName="bob" mucName="mucName" inProd="true" msgType="message" push="true"/><body>first message edited now</body></message><delay from="[conference.dev.dxmpp.com](http://conference.dev.dxmpp.com/)" stamp="2023-10-03T07:15:14.425072Z" xmlns="urn:xmpp:delay"/></forwarded></result></message>

The "replaced" tag shows that the message was edited

dzinzyura commented 1 year ago

done. thank you guys @dendidibe @transkarpation !