Browse Source

photoUrl in tribe chat params

feature/dockerfile-arm
Evan Feenstra 5 years ago
parent
commit
96c120c099
  1. 5
      api/controllers/chats.ts
  2. 5
      dist/api/controllers/chats.js
  3. 2
      dist/api/controllers/chats.js.map

5
api/controllers/chats.ts

@ -68,7 +68,7 @@ async function createGroupChat(req, res) {
let chatParams:any = null let chatParams:any = null
if(is_tribe){ if(is_tribe){
chatParams = await createTribeChatParams(owner, contact_ids, name) chatParams = await createTribeChatParams(owner, contact_ids, name, img)
if(is_listed){ if(is_listed){
// publish to tribe server // publish to tribe server
tribes.declare({ tribes.declare({
@ -474,7 +474,7 @@ function createGroupChatParams(owner, contactIds, members, name) {
} }
} }
async function createTribeChatParams(owner, contactIds, name) { async function createTribeChatParams(owner, contactIds, name, img) {
let date = new Date() let date = new Date()
date.setMilliseconds(0) date.setMilliseconds(0)
if (!(owner && contactIds && Array.isArray(contactIds))) { if (!(owner && contactIds && Array.isArray(contactIds))) {
@ -488,6 +488,7 @@ async function createTribeChatParams(owner, contactIds, name) {
return { return {
uuid: groupUUID, uuid: groupUUID,
contactIds: JSON.stringify(theContactIds), contactIds: JSON.stringify(theContactIds),
photoUrl: img||'',
createdAt: date, createdAt: date,
updatedAt: date, updatedAt: date,
name: name, name: name,

5
dist/api/controllers/chats.js

@ -65,7 +65,7 @@ function createGroupChat(req, res) {
})); }));
let chatParams = null; let chatParams = null;
if (is_tribe) { if (is_tribe) {
chatParams = yield createTribeChatParams(owner, contact_ids, name); chatParams = yield createTribeChatParams(owner, contact_ids, name, img);
if (is_listed) { if (is_listed) {
// publish to tribe server // publish to tribe server
tribes.declare(Object.assign(Object.assign({}, chatParams), { pricePerMessage: price_per_message, priceToJoin: price_to_join, description, tags, img })); tribes.declare(Object.assign(Object.assign({}, chatParams), { pricePerMessage: price_per_message, priceToJoin: price_to_join, description, tags, img }));
@ -447,7 +447,7 @@ function createGroupChatParams(owner, contactIds, members, name) {
type: constants.chat_types.group type: constants.chat_types.group
}; };
} }
function createTribeChatParams(owner, contactIds, name) { function createTribeChatParams(owner, contactIds, name, img) {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
let date = new Date(); let date = new Date();
date.setMilliseconds(0); date.setMilliseconds(0);
@ -461,6 +461,7 @@ function createTribeChatParams(owner, contactIds, name) {
return { return {
uuid: groupUUID, uuid: groupUUID,
contactIds: JSON.stringify(theContactIds), contactIds: JSON.stringify(theContactIds),
photoUrl: img || '',
createdAt: date, createdAt: date,
updatedAt: date, updatedAt: date,
name: name, name: name,

2
dist/api/controllers/chats.js.map

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save