next generate_api
authornk
Fri, 22 Feb 2019 11:16:18 +0100
branchgenerate_api
changeset 33089e14e43ad5ba
parent 3302 9bcfd8ff14a9
child 3309 f6ce35d3e977
next
api/message_api.yml2
     1.1 --- a/api/message_api.yml2	Thu Feb 21 18:04:35 2019 +0100
     1.2 +++ b/api/message_api.yml2	Fri Feb 22 11:16:18 2019 +0100
     1.3 @@ -8,42 +8,35 @@
     1.4  
     1.5  
     1.6  enum text_format {
     1.7 -	hex text_format_plain 0x0;
     1.8 -	hex text_format_html 0x01;
     1.9 +	hex text_format_plain 0;
    1.10 +	hex text_format_html 1;
    1.11  	hex text_format_other 0xff;
    1.12  }
    1.13  
    1.14  
    1.15  enum msg_direction {
    1.16 -	hex dir_incoming 0x0;
    1.17 -	hex dir_outgoing 0x01;
    1.18 +	item dir_incoming 0;
    1.19 +	item dir_outgoing 1;
    1.20  }
    1.21  
    1.22  
    1.23  enum enc_format {
    1.24 -	hex enc_none 0x0 doc='message is not encrypted';
    1.25 -	hex enc_pieces 0x01 doc='inline PGP + PGP extensions';
    1.26 -	hex enc_S_MIME 0x02 doc='RFC5751';
    1.27 -	hex enc_PGP_MIME 0x04 doc='RFC3156';
    1.28 -	hex enc_PEP 0x08 doc='pEp encryption format';
    1.29 -	hex enc_PGP_MIME_Outlook1 0x10 doc='Message B0rken by Outlook type 1';
    1.30 -}
    1.31 -
    1.32 -
    1.33 -enum message_wrap_type {
    1.34 -	message_default doc='typical inner/outer message 2.0';
    1.35 -	message_transport doc='e.g. for onion layers';
    1.36 -	message_key_reset doc='for wrapped key reset information';
    1.37 +	item enc_none 0 doc='message is not encrypted';
    1.38 +	item enc_pieces 1 doc='inline PGP + PGP extensions';
    1.39 +	item enc_S_MIME 2 doc='RFC5751';
    1.40 +	item enc_PGP_MIME 3 doc='RFC3156';
    1.41 +	item enc_PEP 4 doc='pEp encryption format';
    1.42 +	item enc_PGP_MIME_Outlook1 5 doc='Message B0rken by Outlook type 1';
    1.43  }
    1.44  
    1.45  
    1.46  struct message {
    1.47  field msg_direction dir;
    1.48 -	field string id doc='UTF-8 string of message ID';
    1.49 -	field string shortmsg doc='UTF-8 string of short message';
    1.50 -	field string longmsg doc='UTF-8 string of long message'(plain)';
    1.51 -	field string longmsg_formatted doc='UTF-8 string of long message (formatted)';
    1.52 -   	field bloblist_t attachments doc='blobs with attachements';
    1.53 +	field string id doc='string of message ID';
    1.54 +	field string shortmsg doc='string of short message';
    1.55 +	field string longmsg doc='string of long message'(plain)';
    1.56 +	field string longmsg_formatted doc='string of long message (formatted)';
    1.57 +   	field bloblist attachments doc='blobs with attachements';
    1.58  	field char rawmsg_ref doc='reference to raw message data';
    1.59  	field size_t rawmsg_size doc='size of raw message data';
    1.60  	field timestamp sent doc='when the message is sent';
    1.61 @@ -54,12 +47,12 @@
    1.62  	field identity_list cc doc='whom a CC is being sent';
    1.63  	field identity_list bcc doc='whom a BCC is being sent';
    1.64  	field identity_list reply_to doc='where a reply should go to';
    1.65 -	field string in_reply_to doc='list of UTF-8 strings with MessageIDs of refering messages';
    1.66 +	field string in_reply_to doc='list of strings with MessageIDs of refering messages';
    1.67  	field struct _message refering_msg_ref doc='reference to refering message';
    1.68 -	field string references doc='list of UTF-8 strings with references';
    1.69 +	field string references doc='list of strings with references';
    1.70  	field struct _message_ref_list refered_by doc='list of references to messages being refered';
    1.71 -    field string keywords doc='list of UTF-8 strings with keywords';
    1.72 -    field string char comments doc='UTF-8 string with comments';
    1.73 +    field string keywords doc='list of strings with keywords';
    1.74 +    field string char comments doc='string with comments';
    1.75      field stringpair_list_t opt_fields doc='optional fields';
    1.76      field enc_format enc_format doc='format of encrypted data';
    1.77  }
    1.78 @@ -474,12 +467,41 @@
    1.79  }	
    1.80  
    1.81  
    1.82 +	// ratings
    1.83 +
    1.84 +	ratings {
    1.85 +		item rating_undefined 0;
    1.86 +		item rating_cannot_decrypt 1;
    1.87 +		item rating_have_no_key 2;
    1.88 +		item rating_unencrypted 3;
    1.89 +		item rating_unencrypted_for_some doc="don't use this any more",
    1.90 +		item rating_unreliable 4;
    1.91 +		item rating_reliable 5;
    1.92 +		item rating_trusted 6;
    1.93 +		item rating_trusted_and_anonymized 7;
    1.94 +		item rating_fully_anonymous 8;
    1.95 +		item rating_mistrust -1;
    1.96 +		item rating_b0rken -2;
    1.97 +		item rating_under_attack -3;
    1.98 +	}
    1.99 +
   1.100 +
   1.101 +	// colors
   1.102 +
   1.103 +	colors {
   1.104 +		item color_no_color 0;
   1.105 +		item color_yellow 1;
   1.106 +		item color_green 2;
   1.107 +		item color_red -1;
   1.108 +	}
   1.109 +
   1.110 +
   1.111  	func color_from_rating
   1.112  		doc="calculate color from rating"
   1.113  	{
   1.114  		// parms
   1.115  
   1.116 -		provide color_from_rating rating doc="color representing that rating"
   1.117 +		use color_from_rating rating doc="color representing that rating"
   1.118  
   1.119  		// return value
   1.120  		return color rating_color doc="color representing that rating"
   1.121 @@ -505,48 +527,6 @@
   1.122  
   1.123  
   1.124  
   1.125 -
   1.126 -
   1.127 -
   1.128 -
   1.129 -
   1.130 -
   1.131 -
   1.132 -
   1.133 -
   1.134 -
   1.135 -
   1.136 -	// ratings
   1.137 -
   1.138 -	ratings {
   1.139 -		item rating_undefined 0;
   1.140 -		item rating_cannot_decrypt 1;
   1.141 -		item rating_have_no_key 2;
   1.142 -		item rating_unencrypted 3;
   1.143 -		item rating_unencrypted_for_some doc="don't use this any more",
   1.144 -		item rating_unreliable 4;
   1.145 -		item rating_reliable 5;
   1.146 -		item rating_trusted 6;
   1.147 -		item rating_trusted_and_anonymized 7;
   1.148 -		item rating_fully_anonymous 8;
   1.149 -		item rating_mistrust -1;
   1.150 -		item rating_b0rken -2;
   1.151 -		item rating_under_attack -3;
   1.152 -	}
   1.153 -
   1.154 -	// colors
   1.155 -
   1.156 -	colors {
   1.157 -		item color_no_color 0;
   1.158 -		item color_yellow 1;
   1.159 -		item color_green 2;
   1.160 -		item color_red -1;
   1.161 -	}
   1.162 -
   1.163 -
   1.164 -
   1.165 -
   1.166 -
   1.167  	
   1.168  
   1.169