Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add internal hubot to private chats by default #7550

Closed
designgurudotorg opened this issue Jul 24, 2017 · 16 comments
Closed

Add internal hubot to private chats by default #7550

designgurudotorg opened this issue Jul 24, 2017 · 16 comments
Milestone

Comments

@designgurudotorg
Copy link
Contributor

What's the easiest way to do this guys and gals? Ideally it would be a default admin setting to toggle on or off (if on the hubot could repond to requests in every private chat until it's been removed from the chat.)

@reetp
Copy link

reetp commented Jul 24, 2017

This was reported here :
#3132

I would like to see the internal hubot in a private group - none of our groups are public

@reetp
Copy link

reetp commented Jul 24, 2017

I am experiencing this or similar on v0.57.2 - CentOS 6, Node 4.8.x

If I create a Public channel I can add and chat to the internal hubot.
If I convert it to Private the bot does not respond
Convert back it Public and it works again

@reetp
Copy link

reetp commented Aug 1, 2017

Any thoughts on this form the rocket devs ?
Having the ability to have the internal hubot on Private chats would be very useful (and currently you are allowed to add it to a Private chat so you assume it will work, but it won't respond which is confusing)

@reetp
Copy link

reetp commented Aug 10, 2017

@MartinSchoeler
You closed #3132. You asked me to open another bug, but one was opened at the same time so I added to it rather than create new.
Are the devs looking at it ?

@reetp
Copy link

reetp commented Aug 30, 2017

Anyone looking at his ?

Still exists on 0.58.2

@eloo
Copy link

eloo commented Sep 5, 2017

also this seems not be fixed in 0.59.0-rc3

update:
still not fixed in 0.59.0-rc4

@reetp
Copy link

reetp commented Sep 21, 2017

Still no progress with this ?
It IS a bug in that you can allow the internal hubot in private rooms but it cannot react.
I presume it is just a switch in the DB ?

@veerjainATgmail
Copy link

Are there any technical limitation to support Hubot in the private chat???

@reetp
Copy link

reetp commented Oct 23, 2017

@veerjainATgmail not as far as I am aware. If it works in a public chat I'd guess it should work in private.

I'm still scratching my head as to why this bug is ignored for so long. It's irritating, and frustrating not to have the functionality.

I'm no JS coder so not even sure where to start digging. Perhaps a dev will deign to shed some light on it?

@MatthieuPERIN
Copy link

👍 Even using ROCKETCHAT_ROOM='' and LISTEN_ON_ALL_PUBLIC=true do nothing on docker compose ...

@JSzaszvari
Copy link
Contributor

It IS a bug in that you can allow the internal hubot in private rooms but it cannot react.

I assume you mean in a one on one conversation, because hubot works perfect in private rooms.

@reetp
Copy link

reetp commented Oct 29, 2017

No - the internal bot doesn't work in private rooms/groups.

See #3132 as well, though I have not rested this

Set a room to Public. Bot responds as expected.
e.g @rocket.cat weather london
rocket.cat 12:00 PM
It is currently 12ºC Partly Cloudy, 67% humidity

Set room to Private. Bot fails to respond at all.
e.g @rocket.cat weather london
No response

Set it back to Public and it responds again.
e.g @rocket.cat weather london
rocket.cat 12:00 PM
It is currently 12ºC Partly Cloudy, 67% humidity

This has been ongoing for several versions as far as I can see.

@ramrami
Copy link
Contributor

ramrami commented Nov 23, 2017

I think I found where the problem is. If you open the internal hubot source code there is this function :

const InternalHubotReceiver = (message) => {
	if (DEBUG) { console.log(message); }
	if (message.u.username !== InternalHubot.name) {
		const room = RocketChat.models.Rooms.findOneById(message.rid);

		if (room.t === 'c') {
			const InternalHubotUser = new Hubot.User(message.u.username, {room: message.rid});
			const InternalHubotTextMessage = new Hubot.TextMessage(InternalHubotUser, message.msg, message._id);
			InternalHubot.adapter.receive(InternalHubotTextMessage);
		}
	}
	return message;
};

You can see that there is a condition on the room type if (room.t === 'c') if you comment it the bot will response on private chat.
I don't know what the 'c' means , if someone can explain what are the rooms type.

@eloo
Copy link

eloo commented Nov 23, 2017

@ramrami seems to be the room type described here
https://rocket.chat/docs/developer-guides/realtime-api/the-room-object/
maybe you can try to allow it to c and p (maybe d?)

@ramrami
Copy link
Contributor

ramrami commented Nov 23, 2017

@eloo yes thank you. I think this should be added to the Internal Hubot as a setting.

@ramrami
Copy link
Contributor

ramrami commented Nov 23, 2017

I just created an PR to solve this issue : #8933

@rodrigok rodrigok added this to the 0.62.0 milestone Feb 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants