Skip to content

No Usernames in Request at Outgoing Webhook for Direct Messages #322

@0ndifined

Description

@0ndifined

This issue extends this issue: RocketChat#10416

I'm trying to create a webhook that sends a notification when a direct message has been written to a specified user. For that, I want to add a script that just checks whether the direct message is sent to the specified user. Unfortunately, the username of the user who receives the message is not part of the request that I can access in the script. The request only consists of this:

	room: {
		_id: 'TAQvbQBejX3HDEcKQzyaX5AbGaA9bH7APu',
		_updatedAt: 2018 - 04 - 20T08: 17: 15.092Z,
		t: 'd',
		msgs: 18,
		ts: 2018 - 04 - 11T08: 17: 22.471Z,
		lm: 2018 - 04 - 20T08: 17: 15.031Z,
		username: 'myUser',
		usernames: ['**this_will_be_filled_in_with_usernames_when_replayed**']
	},
	siteUrl: 'https://myURL'

So the array for the usernames is not filled but only show this info-string "this_will_be_filled_in_with_usernames_when_replayed". It should actually contain the list of users in that room. Also, replaying the outgoing webhook event doesn't help.

This is a problem specific to the Assistify fork. The problem probably is created at the handling of the usernames in the room object in the response. The data is build here:

Rocket.Chat/packages/rocketchat-integrations/server/lib/triggerHandler.js

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions