changeset 2218:b56be18d5a04

Update OTR comments
author Mikael Berthe <mikael@lilotux.net>
date Thu, 05 Nov 2015 23:29:59 +0100
parents c9640971beec
children 3958793d0d03
files mcabber/mcabber/otr.c
diffstat 1 files changed, 13 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/mcabber/mcabber/otr.c	Thu Nov 05 23:11:43 2015 +0100
+++ b/mcabber/mcabber/otr.c	Thu Nov 05 23:29:59 2015 +0100
@@ -546,9 +546,9 @@
 
 #endif /* HAVE_LIBOTR3 */
 
-/*
- * returns whether a otr_message was received
- * sets *otr_data to NULL, when it was an internal otr message
+/*  otr_receive
+ * Returns whether a otr_message was received.
+ * Sets *otr_data to NULL, when it was an internal otr message.
  */
 int otr_receive(char **otr_data, const char *buddy, int *free_msg)
 {
@@ -598,6 +598,14 @@
   return 0;
 }
 
+/*  otr_send
+ * Returns a newly allocated string, or NULL if no message should be sent.
+ * Sets *encryption_status to 1 if "the otr context is encrypted or otr tries
+ * to establish a session before the message is sent".
+ * (If the session isn't established, but the user choose "otr required", then
+ * the string just contains the "initiate session" message, not the message of
+ * the user.)
+ */
 char *otr_send(const char *msg, const char *buddy, int *encryption_status)
 {
   gcry_error_t err;
@@ -645,9 +653,9 @@
 
   if (!newmessage) {
     if (*encryption_status == 1)
-      return NULL;  // This message should have been encrypted
+      return NULL;  /* This message should have been encrypted */
 
-    // If not, the encryption was not required - send the original message
+    /* If not, the encryption was not required - send the original message */
     return g_strdup(msg);
   }