pEp_utility.cpp
branchkeysync
changeset 177 4d197f1c3abb
parent 172 112b0fac353d
child 180 51f843f18dd2
     1.1 --- a/pEp_utility.cpp	Tue Oct 04 22:04:52 2016 +0200
     1.2 +++ b/pEp_utility.cpp	Tue Oct 04 23:00:44 2016 +0200
     1.3 @@ -27,11 +27,11 @@
     1.4                  address = utf8_string(_ident->address);
     1.5              if (_ident->fpr)
     1.6                  fpr = utf8_string(_ident->fpr);
     1.7 -            if (_ident->user_id)
     1.8 -                user_id = utf8_string(_ident->user_id);
     1.9 +            if (_ident->userId)
    1.10 +                user_id = utf8_string(_ident->userId);
    1.11              if (_ident->username)
    1.12                  username = utf8_string(_ident->username);
    1.13 -            comm_type = _ident->comm_type;
    1.14 +            comm_type = _ident->commType;
    1.15              if (_ident->lang)
    1.16                  lang = utf8_string(_ident->lang);
    1.17          }
    1.18 @@ -64,11 +64,11 @@
    1.19                  throw bad_alloc();
    1.20  
    1.21              _ident->address = utf16_bstr(this->address);
    1.22 -            _ident->comm_type = this->comm_type;
    1.23 +            _ident->commType = this->comm_type;
    1.24              _ident->fpr = utf16_bstr(this->fpr);
    1.25              _ident->lang = utf16_bstr(this->lang);
    1.26              _ident->username = utf16_bstr(this->username);
    1.27 -            _ident->user_id = utf16_bstr(this->user_id);
    1.28 +            _ident->userId = utf16_bstr(this->user_id);
    1.29  
    1.30              return _ident;
    1.31          }
    1.32 @@ -84,10 +84,10 @@
    1.33                  if (ident->fpr)
    1.34                      ident_s->fpr = utf16_bstr(ident->fpr);
    1.35                  if (ident->user_id)
    1.36 -                    ident_s->user_id = utf16_bstr(ident->user_id);
    1.37 +                    ident_s->userId = utf16_bstr(ident->user_id);
    1.38                  if (ident->username)
    1.39                      ident_s->username = utf16_bstr(ident->username);
    1.40 -                ident_s->comm_type = (pEpComType) ident->comm_type;
    1.41 +                ident_s->commType = (pEpComType) ident->comm_type;
    1.42                  if (ident->lang)
    1.43                      ident_s->lang = utf16_bstr(ident->lang);
    1.44              }
    1.45 @@ -117,8 +117,8 @@
    1.46                      throw invalid_argument("invalid hex digits in fingerprint");
    1.47                  }
    1.48              }
    1.49 -            if (ident->user_id)
    1.50 -                _user_id = utf8_string(ident->user_id);
    1.51 +            if (ident->userId)
    1.52 +                _user_id = utf8_string(ident->userId);
    1.53              if (ident->username)
    1.54                  _username = utf8_string(ident->username);
    1.55  
    1.56 @@ -127,7 +127,7 @@
    1.57              if (_ident == NULL)
    1.58                  throw bad_alloc();
    1.59  
    1.60 -            _ident->comm_type = (PEP_comm_type) ident->comm_type;
    1.61 +            _ident->comm_type = (PEP_comm_type) ident->commType;
    1.62  
    1.63              if (ident->lang) {
    1.64                  string _lang = utf8_string(ident->lang);
    1.65 @@ -177,7 +177,7 @@
    1.66              Blob *_blob = new Blob();
    1.67  
    1.68              _blob->value = sa.Detach();
    1.69 -            _blob->mime_type = bstr(tl->mime_type);
    1.70 +            _blob->mimeType = bstr(tl->mime_type);
    1.71              _blob->filename = bstr(tl->filename);
    1.72  
    1.73              return _blob;
    1.74 @@ -210,7 +210,7 @@
    1.75              SysFreeString(ident.fpr);
    1.76              SysFreeString(ident.lang);
    1.77              SysFreeString(ident.username);
    1.78 -            SysFreeString(ident.user_id);
    1.79 +            SysFreeString(ident.userId);
    1.80  
    1.81              memset(&ident, 0, sizeof(pEpIdentity));
    1.82          }
    1.83 @@ -270,18 +270,18 @@
    1.84              SysFreeString(msg->id);
    1.85              SysFreeString(msg->shortmsg);
    1.86              SysFreeString(msg->longmsg);
    1.87 -            SysFreeString(msg->longmsg_formatted);
    1.88 +            SysFreeString(msg->longmsgFormatted);
    1.89              SafeArrayDestroy(msg->attachments);
    1.90              clear_identity_s(msg->from);
    1.91              SafeArrayDestroy(msg->to);
    1.92 -            clear_identity_s(msg->recv_by);
    1.93 +            clear_identity_s(msg->recvBy);
    1.94              SafeArrayDestroy(msg->cc);
    1.95              SafeArrayDestroy(msg->bcc);
    1.96 -            SafeArrayDestroy(msg->reply_to);
    1.97 +            SafeArrayDestroy(msg->replyTo);
    1.98              SafeArrayDestroy(msg->references);
    1.99              SafeArrayDestroy(msg->keywords);
   1.100              SysFreeString(msg->comments);
   1.101 -            SafeArrayDestroy(msg->opt_fields);
   1.102 +            SafeArrayDestroy(msg->optFields);
   1.103  
   1.104              memset(msg, 0, sizeof(TextMessage));
   1.105          }
   1.106 @@ -297,7 +297,7 @@
   1.107              msg2->id = bstr(msg->id);
   1.108              msg2->shortmsg = bstr(msg->shortmsg);
   1.109              msg2->longmsg = bstr(msg->longmsg);
   1.110 -            msg2->longmsg_formatted = bstr(msg->longmsg_formatted);
   1.111 +            msg2->longmsgFormatted = bstr(msg->longmsg_formatted);
   1.112              msg2->attachments = array_from_C<Blob, bloblist_t>(msg->attachments);
   1.113              if (msg->sent)
   1.114                  msg2->sent = mktime(msg->sent);
   1.115 @@ -305,14 +305,14 @@
   1.116                  msg2->recv = mktime(msg->recv);
   1.117              msg2->from = identity_s(msg->from);
   1.118              msg2->to = array_from_C<pEpIdentity, identity_list>(msg->to);
   1.119 -            msg2->recv_by = identity_s(msg->recv_by);
   1.120 +            msg2->recvBy = identity_s(msg->recv_by);
   1.121              msg2->cc = array_from_C<pEpIdentity, identity_list>(msg->cc);
   1.122              msg2->bcc = array_from_C<pEpIdentity, identity_list>(msg->bcc);
   1.123 -            msg2->reply_to = array_from_C<pEpIdentity, identity_list>(msg->reply_to);
   1.124 +            msg2->replyTo = array_from_C<pEpIdentity, identity_list>(msg->reply_to);
   1.125              msg2->references = string_array(msg->references);
   1.126              msg2->keywords = string_array(msg->keywords);
   1.127              msg2->comments = bstr(msg->comments);
   1.128 -            msg2->opt_fields = array_from_C<StringPair, stringpair_list_t>(msg->opt_fields);
   1.129 +            msg2->optFields = array_from_C<StringPair, stringpair_list_t>(msg->opt_fields);
   1.130          }
   1.131  
   1.132          char * str(BSTR s)
   1.133 @@ -328,7 +328,7 @@
   1.134          void clear_blob(Blob& b)
   1.135          {
   1.136              SysFreeString(b.filename);
   1.137 -            SysFreeString(b.mime_type);
   1.138 +            SysFreeString(b.mimeType);
   1.139              SafeArrayDestroy(b.value);
   1.140              memset(&b, 0, sizeof(Blob));
   1.141          }
   1.142 @@ -379,7 +379,7 @@
   1.143                          throw bad_alloc();
   1.144  
   1.145                  }
   1.146 -                _bl = bloblist_add(_bl, buffer, size, str(b.mime_type), str(b.filename));
   1.147 +                _bl = bloblist_add(_bl, buffer, size, str(b.mimeType), str(b.filename));
   1.148                  if (_bl == NULL) {
   1.149                      free(buffer);
   1.150                      clear_blob(b);
   1.151 @@ -504,23 +504,24 @@
   1.152              msg2->id = str(msg->id);
   1.153              msg2->shortmsg = str(msg->shortmsg);
   1.154              msg2->longmsg = str(msg->longmsg);
   1.155 -            msg2->longmsg_formatted = str(msg->longmsg_formatted);
   1.156 +            msg2->longmsg_formatted = str(msg->longmsgFormatted);
   1.157              msg2->attachments = bloblist(msg->attachments);
   1.158              msg2->sent = new_timestamp(msg->sent);
   1.159              msg2->recv = new_timestamp(msg->recv);
   1.160              msg2->from = new_identity(&msg->from);
   1.161              msg2->to = identities(msg->to);
   1.162 -            msg2->recv_by = new_identity(&msg->recv_by);
   1.163 +            msg2->recv_by = new_identity(&msg->recvBy);
   1.164              msg2->cc = identities(msg->cc);
   1.165              msg2->bcc = identities(msg->bcc);
   1.166 -            msg2->reply_to = identities(msg->reply_to);
   1.167 +            msg2->reply_to = identities(msg->replyTo);
   1.168              msg2->references = new_stringlist(msg->references);
   1.169              msg2->keywords = new_stringlist(msg->keywords);
   1.170              msg2->comments = str(msg->comments);
   1.171 -            msg2->opt_fields = stringpair_list(msg->opt_fields);
   1.172 +            msg2->opt_fields = stringpair_list(msg->optFields);
   1.173  
   1.174              return msg2;
   1.175          }
   1.176 +
   1.177  		void opt_field_array_from_C(stringpair_list_t* spair_list, LPSAFEARRAY* pair_list_out) {
   1.178  			assert(spair_list);
   1.179  			assert(pair_list_out);
   1.180 @@ -530,6 +531,7 @@
   1.181  
   1.182  			*pair_list_out = array_from_C<StringPair, stringpair_list_t>(spair_list);
   1.183  		}
   1.184 +
   1.185  		void clear_opt_field_array(LPSAFEARRAY* opt_field_array) {
   1.186  			SafeArrayDestroy(*opt_field_array);
   1.187  			//memset(*opt_field_array, 0, sizeof(SAFEARRAY*));