Skip to content

[NEW] Livechat API to get and set location of user to database.#14765

Open
knrt10 wants to merge 2 commits intoRocketChat:developfrom
knrt10:iplocation
Open

[NEW] Livechat API to get and set location of user to database.#14765
knrt10 wants to merge 2 commits intoRocketChat:developfrom
knrt10:iplocation

Conversation

@knrt10
Copy link
Copy Markdown
Contributor

@knrt10 knrt10 commented Jun 8, 2019

@renatobecker would you please review.

@reetp
Copy link
Copy Markdown
Collaborator

reetp commented Jun 13, 2019

Has any of this been looked at for GDPR compliance?
How is location obtained?
Is a user advised?
Can it be enabled/disabled?

@knrt10
Copy link
Copy Markdown
Contributor Author

knrt10 commented Jun 14, 2019

@reetp I am looking into GDPR compliance and user will be notified. Regarding getting location, it is implemented on Livechat Client. Will be updating client PR for asking user permission and GDPR compliance.

@reetp
Copy link
Copy Markdown
Collaborator

reetp commented Jun 14, 2019

@reetp I am looking into GDPR compliance and user will be notified. Regarding getting location, it is implemented on Livechat Client. Will be updating client PR for asking user permission and GDPR compliance.

If stored the data must be removable from the database as well.

post() {
check(this.bodyParams, {
token: String,
location: Object,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's describe and check the whole location object structure, okay?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool

super('livechat_sessions');
}

getUserLocationByToken(token) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
getUserLocationByToken(token) {
findOneVisitorLocationByToken(token) {

return this.findOne(query);
}

saveLocationForUser(locationData) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
saveLocationForUser(locationData) {
saveVisitorLocation(data={}) {

saveLocationForUser(locationData) {
const { token, location } = locationData;

return this.insert({
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return this.insert({
return this.upsert({

Copy link
Copy Markdown
Contributor Author

@knrt10 knrt10 Jun 23, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried this but it is not working, throwing an error. Insert is working fine.

});
},

checkUserLocation(token) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
checkUserLocation(token) {
getVisitorLocation(token) {

return LivechatSessions.getUserLocationByToken(token);
},

addUserLocationData(locationData) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
addUserLocationData(locationData) {
updateVisitorLocation(data={}) {

@engelgabriel
Copy link
Copy Markdown
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants