Skip to content

Commit

Permalink
Merge pull request #96 from depromeet/dev
Browse files Browse the repository at this point in the history
채팅방 내부시에 채팅알림 끔
  • Loading branch information
ImNM authored Jun 18, 2022
2 parents 1f8fe89 + 949a98f commit 43f8045
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/apis/alarm/dto/userFcmInfo.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export const userFcmInfoSelect = {
FCMToken: 1,
appAlarm: 1,
chatAlarm: 1,
iJoin: 1,
};
export class UserFcmInfoDto {
// @Transform(({ value }) => new Types.ObjectId(value), { toClassOnly: true })
Expand All @@ -20,4 +21,6 @@ export class UserFcmInfoDto {

@Expose()
chatAlarm: boolean;
@Expose()
isJoin: boolean;
}
3 changes: 3 additions & 0 deletions src/apis/alarm/pushAlarm.processor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export class PushAlarmProcessor {
console.log(result);
}
}

@OnQueueFailed()
errorhandler(job: Job, err: Error) {
console.log(err);
Expand Down Expand Up @@ -95,8 +96,10 @@ export class PushAlarmProcessor {
const checkPushReciverIsSender = !e._id.equals(chatAlarmSubDto.sender);
const checkAppAlarmOn = e.appAlarm;
const checkChatAlarmOn = e.chatAlarm;
const checkRoomJoin = !e.isJoin;
const checkFCMTokenValid = e.FCMToken.length === 0 ? false : true;
return (
checkRoomJoin &&
checkPushReciverIsSender &&
checkChatAlarmOn &&
checkAppAlarmOn &&
Expand Down
7 changes: 7 additions & 0 deletions src/models/user.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,13 @@ export class User {
@Expose()
level: number;

@Prop({
type: Boolean,
default: false,
})
@Expose()
isJoin: boolean;

lastChat: Types.ObjectId | null;
}

Expand Down

0 comments on commit 43f8045

Please sign in to comment.