// loop through all trust entries in xml and add to database if we don't already know them\r
for(long i=0; i<xml.TrustCount(); i++)\r
{\r
- int id;\r
+ int id=-1;\r
std::string identity;\r
std::string messagetrustcomment="";\r
std::string trustlisttrustcomment="";\r
st.Reset();\r
\r
//insert trust for this identity\r
- trustst.Bind(0,identityid);\r
- trustst.Bind(1,id);\r
- if(xml.GetMessageTrust(i)==-1)\r
+ if(id!=-1)\r
{\r
- trustst.Bind(2);\r
- }\r
- else\r
- {\r
- trustst.Bind(2,xml.GetMessageTrust(i));\r
- }\r
- if(xml.GetTrustListTrust(i)==-1)\r
- {\r
- trustst.Bind(3);\r
- }\r
- else\r
- {\r
- trustst.Bind(3,xml.GetTrustListTrust(i));\r
- }\r
- messagetrustcomment=xml.GetMessageTrustComment(i);\r
- trustlisttrustcomment=xml.GetTrustListTrustComment(i);\r
- // limit comments to 50 characters each\r
- if(messagetrustcomment.size()>50)\r
- {\r
- messagetrustcomment.erase(50);\r
- }\r
- if(trustlisttrustcomment.size()>50)\r
- {\r
- trustlisttrustcomment.erase(50);\r
+ trustst.Bind(0,identityid);\r
+ trustst.Bind(1,id);\r
+ if(xml.GetMessageTrust(i)==-1)\r
+ {\r
+ trustst.Bind(2);\r
+ }\r
+ else\r
+ {\r
+ trustst.Bind(2,xml.GetMessageTrust(i));\r
+ }\r
+ if(xml.GetTrustListTrust(i)==-1)\r
+ {\r
+ trustst.Bind(3);\r
+ }\r
+ else\r
+ {\r
+ trustst.Bind(3,xml.GetTrustListTrust(i));\r
+ }\r
+ messagetrustcomment=xml.GetMessageTrustComment(i);\r
+ trustlisttrustcomment=xml.GetTrustListTrustComment(i);\r
+ // limit comments to 50 characters each\r
+ if(messagetrustcomment.size()>50)\r
+ {\r
+ messagetrustcomment.erase(50);\r
+ }\r
+ if(trustlisttrustcomment.size()>50)\r
+ {\r
+ trustlisttrustcomment.erase(50);\r
+ }\r
+ trustst.Bind(4,messagetrustcomment);\r
+ trustst.Bind(5,trustlisttrustcomment);\r
+ trustst.Step();\r
+ trustst.Reset();\r
}\r
- trustst.Bind(4,messagetrustcomment);\r
- trustst.Bind(5,trustlisttrustcomment);\r
- trustst.Step();\r
- trustst.Reset();\r
-\r
}\r
+\r
trustst.Finalize();\r
st.Finalize();\r
\r