Skip to content

Commit

Permalink
Merge pull request #40 from alkem-io/develop
Browse files Browse the repository at this point in the history
Release v0.4.1
  • Loading branch information
hero101 authored Jul 4, 2024
2 parents c299c52 + 68a0114 commit c2b63b8
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 14 deletions.
4 changes: 2 additions & 2 deletions service/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion service/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "alkemio-matrix-adapter",
"version": "0.4.0",
"version": "0.4.1",
"description": "Alkemio Matrix Adapter service",
"author": "Alkemio Foundation",
"private": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { EventType } from 'matrix-js-sdk';

@Injectable()
export class MatrixMessageAdapter {
readonly FILTERED_EVENT_TYPES = [EventType.RoomMessage, EventType.Reaction];
readonly ALLOWED_EVENT_TYPES = [EventType.RoomMessage, EventType.Reaction];

constructor(
@Inject(WINSTON_MODULE_NEST_PROVIDER)
Expand Down Expand Up @@ -87,16 +87,15 @@ export class MatrixMessageAdapter {
isEventToIgnore(message: MatrixRoomResponseMessage): boolean {
const event = message.event;

if (event.type) {
for (const type of this.FILTERED_EVENT_TYPES) {
if (event.type === type) {
this.logger.verbose?.(
`[Timeline] Ignoring event of type: ${event.type} as it is not one of '${this.FILTERED_EVENT_TYPES}' types `,
LogContext.COMMUNICATION
);
return true;
}
}
if (
event.type &&
!this.ALLOWED_EVENT_TYPES.every(type => event.type !== type)
) {
this.logger.verbose?.(
`[Timeline] Ignoring event of type: ${event.type} as it is not one of '${this.ALLOWED_EVENT_TYPES}' types `,
LogContext.COMMUNICATION
);
return true;
}

const content = message.getContent();
Expand Down

0 comments on commit c2b63b8

Please sign in to comment.