@xuda.io/account_module 1.2.1611 → 1.2.1612
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.mjs +6 -6
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -2023,7 +2023,7 @@ export const add_contact = async function (req, job_id, headers) {
|
|
|
2023
2023
|
}
|
|
2024
2024
|
|
|
2025
2025
|
const save_ret = await save_contact(uid, contact_obj);
|
|
2026
|
-
|
|
2026
|
+
save_xuda_cache(uid, 'contact', contact_obj.email, null, contact_obj);
|
|
2027
2027
|
if (!is_spam) {
|
|
2028
2028
|
set_contact_profile_picture(uid, contact_obj._id, metadata, job_id, headers);
|
|
2029
2029
|
}
|
|
@@ -2142,8 +2142,8 @@ const set_contact_profile_picture = async function (uid, contact_id, metadata, j
|
|
|
2142
2142
|
|
|
2143
2143
|
if (!cache) {
|
|
2144
2144
|
file_ret = await ai_module.get_profile_picture(uid, contact_obj.account_type, contact_obj.name, { email: contact_obj.email, metadata }, account_profile_info, job_id, headers);
|
|
2145
|
-
|
|
2146
|
-
|
|
2145
|
+
save_xuda_cache(uid, 'profile_picture', contact_obj.name, file_ret.data, { account_type: contact_obj.account_type, type: 'contact' });
|
|
2146
|
+
save_xuda_cache(uid, 'profile_picture', contact_obj.email, file_ret.data, { account_type: contact_obj.account_type, type: 'contact' });
|
|
2147
2147
|
}
|
|
2148
2148
|
if (file_ret.code < 0) {
|
|
2149
2149
|
throw new Error(file_ret.data);
|
|
@@ -2179,8 +2179,8 @@ const set_contact_profile_picture = async function (uid, contact_id, metadata, j
|
|
|
2179
2179
|
job_id,
|
|
2180
2180
|
headers,
|
|
2181
2181
|
);
|
|
2182
|
-
|
|
2183
|
-
|
|
2182
|
+
save_xuda_cache(uid, 'profile_avatar', contact_obj.name, file_ret.data, { account_type: contact_obj.account_type, type: 'contact' });
|
|
2183
|
+
save_xuda_cache(uid, 'profile_avatar', contact_obj.email, file_ret.data, { account_type: contact_obj.account_type, type: 'contact' });
|
|
2184
2184
|
}
|
|
2185
2185
|
if (file_ret.code < 0) {
|
|
2186
2186
|
throw new Error(file_ret.data);
|
|
@@ -3020,7 +3020,7 @@ export const find_contact_query = async function (uid, opt) {
|
|
|
3020
3020
|
return ret;
|
|
3021
3021
|
};
|
|
3022
3022
|
|
|
3023
|
-
export const
|
|
3023
|
+
export const save_xuda_cache = async function (uid, docType, name, file, metadata = {}) {
|
|
3024
3024
|
let doc = {
|
|
3025
3025
|
_id: await _common.xuda_get_uuid('cache'),
|
|
3026
3026
|
name,
|