~singpolyma/cheogram

cheogram/Main.hs -rw-r--r-- 109.4 KiB
Blacklist uncommon file extensions

Some MIME types are a bit ambiguous.  Do not use uncommon variants of the file
extension, which our nginx and our clients are unlikely to support.
Move the unregister-from-backend handling up into the from-backend handling area
Merge branch 'register-and-remove-from-backend'

* register-and-remove-from-backend:
  Allow direct message route to notify of removal
  Re-enable registration
Allow direct message route to notify of removal

In case the backend is removing the user for policy reasons, etc, allows us to
clear out the message route setting when the backend is no longer listening.
Re-enable registration

It's not clear why it was ever removed.  I forget, and the commit and the
related issue both just say "disable for now".  So re-enable the code path.  No
one really uses it, but it's not dangerous and gives us a place to put other
registration code as well.
Expire JID Switch Key

I've added an expire command to the DB, and then I'm using it in the
JidSwitch branch.

I picked 24h as the expiry because I figure that'll give them enough
time to do some stuff but not clog up the DB or catch a bunch of people
unawares.
Change JID Command

If the backend sends us a command we recognize as a JID change, we
intercept it and replace it with ours.

Ours asks which JID we want to move to and then asks that JID if it
wants to do this. When they register we ask them to confirm they want to
swap, and then send the backend the actual JID change operation.
Remove cheoJid/owner when removing route

Since we no longer have any reason to believe this JID owns that tel anymore,
and also can't check anymore anyway, so just remove it.
Merge branch 'telToJid'

* telToJid:
  telToJid already does (filter isDigit)
telToJid already does (filter isDigit)

Doing it twice is redundant and breaks international +-prefixed detection.
Set Jingle URL extensions from Magic mimeType
Set cacheOOB URL extension from Magic mimeType
Merge branch 'guix-no-tc'

* guix-no-tc:
  Guixify
  No more TC
  Don't need to rewrite anymore
Don't need to rewrite anymore
Only list keys from TC for the rewrite and print progress
Rewrite DB on boot to ensure all data is in both TC and Redis
Only store muc_membersonly if True

The default is False anyway if not present.

This handler is overbroad and catches any disco#info that isn't caught
elsewhere, but assumes this must be a result from a MUC.  That was probably true
when this was written, but it's certainly not safe and we can see in the DB that
there are muc_membersonly keys set to False for non-MUC JIDs.  This change is
safe and not invasive but will cut down on DB contents at least.
Nothing ever sets resource to create anymore
Ensure that all stanzas coming out of cheogram have ids

They're not required to by the spec, but many usages need them and it's
certainly good practise, so if for any reason a stanza we are about to send
lacks one, add it.
Next