diff --git a/src/pEp/_pEp/identity.cc b/src/pEp/_pEp/identity.cc index 63fbb35..5274c1a 100644 --- a/src/pEp/_pEp/identity.cc +++ b/src/pEp/_pEp/identity.cc @@ -166,28 +166,28 @@ namespace pEp { _throw_status(status); } - Myself::Myself(string address, string username, string user_id, string lang) - : Identity(address, username, user_id, "", 0, lang) { - if (!(address.length() && username.length())) - throw invalid_argument("address and username must be set"); - if (lang.length() && lang.length() != 2) - throw length_error("lang must be an ISO 639-1 language code or empty"); - - // FIXME: should set .me - // _ident->me = true; - if (user_id.length()) - throw runtime_error("user_id feature not yet implemented for Myself"); - } - - void Myself::update() { - pEp::PythonAdapter::myself(*this); - } +// Myself::Myself(string address, string username, string user_id, string lang) +// : Identity(address, username, user_id, "", 0, lang) { +// if (!(address.length() && username.length())) +// throw invalid_argument("address and username must be set"); +// if (lang.length() && lang.length() != 2) +// throw length_error("lang must be an ISO 639-1 language code or empty"); +// +// // FIXME: should set .me +// // _ident->me = true; +// if (user_id.length()) +// throw runtime_error("user_id feature not yet implemented for Myself"); +// } + +// void Myself::update() { +// pEp::PythonAdapter::myself(*this); +// } Identity identity_attr(pEp_identity *&ident) { if (!ident) throw out_of_range("no identity assigned"); - pEp_identity *_dup = identity_dup(ident); + pEp_identity *_dup = ::identity_dup(ident); if (!_dup) throw bad_alloc(); @@ -200,9 +200,9 @@ namespace pEp { pEp_identity *_dup = ::identity_dup(_ident); if (!_dup) throw bad_alloc(); - PEP_STATUS status = update_identity(Adapter::session(), _dup); + PEP_STATUS status = ::update_identity(Adapter::session(), _dup); _throw_status(status); - free_identity(ident); + ::free_identity(ident); ident = _dup; } @@ -220,7 +220,7 @@ namespace pEp { } void identitylist_attr(identity_list *&il, boost::python::list value) { - identity_list *_il = new_identity_list(NULL); + identity_list *_il = ::new_identity_list(NULL); if (!_il) throw bad_alloc(); @@ -233,22 +233,22 @@ namespace pEp { pEp_identity *_ident = extract_identity(); pEp_identity *_dup = ::identity_dup(_ident); if (!_dup) { - free_identity_list(_il); + ::free_identity_list(_il); throw bad_alloc(); } - PEP_STATUS status = update_identity(Adapter::session(), _dup); + PEP_STATUS status = ::update_identity(Adapter::session(), _dup); if (status != PEP_STATUS_OK) { - free_identity_list(_il); + ::free_identity_list(_il); _throw_status(status); } - _i = identity_list_add(_i, _dup); + _i = ::identity_list_add(_i, _dup); if (!_i) { - free_identity_list(_il); + ::free_identity_list(_il); throw bad_alloc(); } } - free_identity_list(il); + ::free_identity_list(il); il = _il; } diff --git a/src/pEp/_pEp/identity.hh b/src/pEp/_pEp/identity.hh index 071ac4a..9149aaf 100644 --- a/src/pEp/_pEp/identity.hh +++ b/src/pEp/_pEp/identity.hh @@ -100,12 +100,12 @@ namespace pEp { void disable_for_sync(); }; - class Myself : public Identity { - public: - Myself(string address, string username, string user_id = "", string lang = ""); - - virtual void update(); - }; +// class Myself : public Identity { +// public: +// Myself(string address, string username, string user_id = "", string lang = ""); +// +// virtual void update(); +// }; Identity identity_attr(pEp_identity *&ident); @@ -118,4 +118,4 @@ namespace pEp { } // namespace PythonAdapter } // namespace pEp -#endif /* IDENTITY_HH */ \ No newline at end of file +#endif /* IDENTITY_HH */ diff --git a/src/pEp/_pEp/pEpmodule.cc b/src/pEp/_pEp/pEpmodule.cc index 73a1f6d..73c1969 100644 --- a/src/pEp/_pEp/pEpmodule.cc +++ b/src/pEp/_pEp/pEpmodule.cc @@ -189,7 +189,7 @@ namespace pEp { boost::locale::generator gen; std::locale::global(gen("")); -// _scope = new scope(); + scope().attr("about") = about(); scope().attr("per_user_directory") = per_user_directory(); scope().attr("per_machine_directory") = per_machine_directory();