about summary refs log tree commit diff stats
path: root/src/xmpp
diff options
context:
space:
mode:
authorMichael Vetter <jubalh@iodoru.org>2019-10-18 16:12:26 +0200
committerMichael Vetter <jubalh@iodoru.org>2019-10-18 16:12:26 +0200
commit4d7a496ae2dff956d473b2951f4232b45cbf6d1a (patch)
tree5753c2fb0e6998944203d442d14ab08b51b23dca /src/xmpp
parent72bdae1014b0835adfa9f0d40ab8a469031ed135 (diff)
downloadprofani-tty-4d7a496ae2dff956d473b2951f4232b45cbf6d1a.tar.gz
Change origin-id/id algo
Hash twice.
Use HMAC SHA256 from glib.
Diffstat (limited to 'src/xmpp')
-rw-r--r--src/xmpp/connection.c20
-rw-r--r--src/xmpp/message.c23
2 files changed, 29 insertions, 14 deletions
diff --git a/src/xmpp/connection.c b/src/xmpp/connection.c
index cfa9db21..e35f19ff 100644
--- a/src/xmpp/connection.c
//: Primitive to convert any type to text (array of characters).
//: Later layers will allow us to override this to do something smarter for
//: specific types.

:(before "End Primitive Recipe Declarations")
TO_TEXT,
:(before "End Primitive Recipe Numbers")
put(Recipe_ordinal, "to-text", TO_TEXT);
:(before "End Primitive Recipe Checks")
case TO_TEXT: {
  if (SIZE(inst.ingredients) != 1) {
    raise << maybe(get(Recipe, r).name) << "'to-text' requires a single ingredient, but got '" << to_original_string(inst) << "'\n" << end();
    break;
  }
  // can handle any type
  break;
}
:(before "End Primitive Recipe Implementations")
case TO_TEXT: {
  products.resize(1);
  products.at(0).push_back(new_mu_text(inspect(current_instruction().ingredients.at(0), ingredients.at(0))));
  break;
}