Commit graph

7 commits

Author SHA1 Message Date
eta c36d61687a Message Archive Management (MAM) support for groupchats
- Groupchats now support XEP-0313 Message Archive Management (MAM)!
- This uses the history stored in the sqlite database, as implemented in the
  previous commits.
  - The QUERY-ARCHIVE megafunction builds up a SQL query to get stuff out of the
    database, in accordance with provided MAM + RSM parameters.
- Notably, various hacks are in here that need to be fixed.
  - IQ 'set's are now processed, which means we needed to add a stub impl of
    Schrödinger's Chat so people don't drop out of MUCs all of a sudden.
    (Well, it just responds to every ping indiscriminately...)
  - Oh also the new presence subscription stuff from earlier is borked.
2020-09-27 23:01:40 +01:00
eta e7c84623e8 Refactor message processing to use an intermediate object
- Instead of taking a WhatsApp message and sending an XMPP one directly, we now
  generate an XMPP-MESSAGE object, and have functions to deliver said object
  and make said object from a WhatsApp message.
- This paves the way to storing said XMPP-MESSAGEs in a database, so we can
  actually do message history / MAM. Yay!
2020-09-26 14:59:12 +01:00
eta 83d172f899 Upload and send images natively (!); don't block on QR code
- This commit contains initial support for uploading and sending images natively
  -- i.e. a WhatsApp image upload, instead of sending through a bare link.
- All images supported by the OPTICL library are supported; this is because WA
  needs us to generate a jpeg thumbnail for the image (which can probably be
  made smaller)
- Importantly, this functionality is currently a trivial DoS vector: simply send
  a large file (or an infinite file, like time.gif) and it ALL gets downloaded
  and buffered into RAM...!
  - At least this is limited to users who have actually registered with the
    bridge.
- Failing to send the image in any way results in an XMPP error getting reported
  back to the sender.
- Also, the initial registration QR code upload thing now happens in another
  thread.
2020-09-01 20:01:02 +01:00
eta 7506da1469 Fix the Nix build (!!) 2020-08-21 18:15:52 +01:00
eta 599123dbef Generate entity caps & process disconnect messages
- The bridge should now support XEP-0115 Entity Capabilities, which actually
  brings us into compliance with XEP-0085 Chat State Notifications (there were
  clients, like Miranda NG, that wouldn't send to us without us actually doing
  this XEP and advertising support in disco#info).
- We now handle the :disconnect message from whatscl, which lets us properly
  deal with the connection being removed from the app or replaced with another
  session. (Before, this would drop the connection, it'd loop and retry, and
  then hit a status code error on login; this way is slightly cleaner and also
  prevents the bridge getting into a war with another bridge.)
- The :ws-open whatscl event never existed. The bridge was doing just fine
  not executing its handler, so it's just been removed. Future work might
  improve the amount of spam sent to the user about the bridge state.
2020-08-01 16:58:50 +01:00
eta ae303489ad bump wsd version 2020-07-13 22:33:57 +01:00
eta 7e457266f8 nix: add Nix derivation for whatsxmpp (yay!)
- Using tazjin's buildLisp.nix (you need the TVL Monorepo installed
  as <depot>), we have a derivation for whatsxmpp and its million
  dependencies.
- The derivation currently just assumes whatscl is in ../whatscl,
  but we'll fix that eventually.
- Also there are tons of buildLisp derivations in here, and even
  two instances where we had to vendor stuff in order to get it to
  work with nix (usually because it had some data file).
- But yay, we can build via docker and it's not utter trash!
2020-07-06 22:44:28 +01:00