while(st.RowReturned())\r
{\r
std::string name="";\r
+ std::string namepart="";\r
std::string publickey="";\r
int identityid=0;\r
st.ResultText(0,name);\r
std::vector<std::string> parts;\r
StringFunctions::Split(name,"@",parts);\r
\r
+ // name can have a @ in it - so reattach all parts except the last which is the key\r
+ for(long i=0; i<parts.size()-1; i++)\r
+ {\r
+ if(i!=0)\r
+ {\r
+ namepart+="@";\r
+ }\r
+ namepart+=parts[i];\r
+ }\r
+\r
// find identities with this name\r
SQLite3DB::Statement st2=m_db->Prepare("SELECT IdentityID,PublicKey FROM tblIdentity WHERE Name=?;");\r
- st2.Bind(0,name);\r
+ st2.Bind(0,namepart);\r
st2.Step();\r
while(st2.RowReturned())\r
{\r
// we have the identity - so update the messages table with the identityid\r
st2.ResultInt(0,identityid);\r
\r
- SQLite3DB::Statement st3=m_db->Prepare("UPDATE tblMessage SET IdentityID=? WHERE Name=? AND IdentityID IS NULL;");\r
+ SQLite3DB::Statement st3=m_db->Prepare("UPDATE tblMessage SET IdentityID=? WHERE FromName=? AND IdentityID IS NULL;");\r
st3.Bind(0,identityid);\r
st3.Bind(1,name);\r
st3.Step();\r