On 3 Mar 2021, at 20:12, george b <[email protected]> wrote:
>
> Hello everyone
>
> Today I have question, specific to Swiften. So maybe Kevin could answer this
> ;-)?
>
> My omemo implementation works as expected now. But from an architecture or
> performance point of view, it is not really smart implemented.
>
> The LurchAdapter Class (which handles all the message parsing and forwarding
> to lurch [1]) catches each incoming Swift::Message stanza. This stanza will
> be serialized to a std::string [2]. Just to be able to parse out the <items>
> or the <encrypted> xml part within a message [3]. This part will then be
> forwarded to lurch, which does the real work on it.
>
> While this works, especially on an embedded device (mobile phone) this has an
> huge resource impact. I tried to get into swiften in more depth and tried to
> implement a class, derived from Swift::Payload, which should do the parsing
> for the 'items' or 'encrypted' payload part. But I don't know how to
> integrate it in the overall parsing of incoming stanzas. My target would be
> to have it somehow integrated in a derived class of Swift::Message which
> could provide me with
> std::string Message::getItems()
> std::string Message::getEncrypted()
>
> Any hints on how to do this, or any clever alternatives are appreciated :-).
If you want a new payload type in Swiften, the quickest way is to follow the
dev guide - https://swift.im/swiften/guide/#Section-Extending
<https://swift.im/swiften/guide/#Section-Extending>
/K
_______________________________________________
JDev mailing list
Info: https://mail.jabber.org/mailman/listinfo/jdev
Unsubscribe: [email protected]
_______________________________________________