This repository was archived by the owner on Oct 11, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +21
-7
lines changed
mutations/directMessageThread
queries/directMessageThread Expand file tree Collapse file tree 3 files changed +21
-7
lines changed Original file line number Diff line number Diff line change 55 checkForExistingDMThread ,
66 getDirectMessageThread ,
77 createDirectMessageThread ,
8+ setDirectMessageThreadLastActive ,
89} from '../../models/directMessageThread' ;
910import { uploadImage } from '../../utils/file-storage' ;
1011import { storeMessage } from '../../models/message' ;
@@ -132,6 +133,7 @@ export default requireAuth(
132133 if ( existingThread ) {
133134 return await Promise . all ( [
134135 setUserLastSeenInDirectMessageThread ( threadId , user . id ) ,
136+ setDirectMessageThreadLastActive ( threadId ) ,
135137 handleStoreMessage ( message ) ,
136138 ] ) . then ( ( ) => threadToReturn ) ;
137139 }
Original file line number Diff line number Diff line change 11// @flow
22import type { GraphQLContext } from '../../' ;
33import { canViewDMThread } from '../../utils/permissions' ;
4+ import { signImageUrl } from 'shared/imgix' ;
45
5- export default async (
6- { id } : { id : string } ,
7- _ : any ,
8- { loaders, user } : GraphQLContext
9- ) => {
6+ export default async ( { id } : { id : string } , _ : any , ctx : GraphQLContext ) => {
7+ const { loaders, user, getImageSignatureExpiration } = ctx ;
108 if ( ! user || ! user . id ) return null ;
119
1210 const canViewThread = await canViewDMThread ( user . id , id , loaders ) ;
@@ -15,6 +13,20 @@ export default async (
1513
1614 return loaders . directMessageParticipants . load ( id ) . then ( results => {
1715 if ( ! results || results . length === 0 ) return null ;
18- return results . reduction ;
16+ return results . reduction . map ( user => {
17+ return {
18+ ...user ,
19+ coverPhoto : signImageUrl ( user . coverPhoto , {
20+ w : 1280 ,
21+ h : 384 ,
22+ expires : getImageSignatureExpiration ( ) ,
23+ } ) ,
24+ profilePhoto : signImageUrl ( user . profilePhoto , {
25+ w : 256 ,
26+ h : 256 ,
27+ expires : getImageSignatureExpiration ( ) ,
28+ } ) ,
29+ } ;
30+ } ) ;
1931 } ) ;
2032} ;
Original file line number Diff line number Diff line change 11{
22 "name" : " Spectrum" ,
3- "version" : " 2.4.54 " ,
3+ "version" : " 2.4.55 " ,
44 "license" : " BSD-3-Clause" ,
55 "devDependencies" : {
66 "babel-cli" : " ^6.24.1" ,
You can’t perform that action at this time.
0 commit comments