-
Notifications
You must be signed in to change notification settings - Fork 10.6k
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
[NEW] Add tags to uploaded images using Google Cloud Vision API #6301
Conversation
That's neat, will those tags be searchable? |
Yes that's in our plans. |
# Conflicts: # packages/rocketchat-lib/lib/callbacks.coffee
@RocketChat/core conflicts have been solved. Can I have some eyes on this? |
# Conflicts: # .meteor/versions # packages/rocketchat-lib/server/functions/sendMessage.coffee # packages/rocketchat-lib/server/functions/settings.coffee
const file = RocketChat.models.Uploads.findOne({ _id: message.file._id }); | ||
if (file && file.type && file.type.indexOf('image') !== -1 && file.store === 'GoogleCloudStorage:Uploads' && file.googleCloudStorage) { | ||
if (this.incCallCount(1)) { | ||
const bucket = this.storageClient.bucket(file.googleCloudStorage.bucket); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we don't store bucket name on the file anymore.
if (file && file.type && file.type.indexOf('image') !== -1 && file.store === 'GoogleCloudStorage:Uploads' && file.googleCloudStorage) { | ||
if (this.incCallCount(1)) { | ||
const bucket = this.storageClient.bucket(file.googleCloudStorage.bucket); | ||
const bucketFile = bucket.file(`${ file.googleCloudStorage.path }${ file._id }`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the file path property changed as well
blockUnsafeImages(message) { | ||
if (this.enabled && this.serviceAccount && message && message.file && message.file._id) { | ||
const file = RocketChat.models.Uploads.findOne({ _id: message.file._id }); | ||
if (file && file.type && file.type.indexOf('image') !== -1 && file.store === 'GoogleCloudStorage:Uploads' && file.googleCloudStorage) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we don't have the file.googleCloudStorage
property anymore.
# Conflicts: # packages/rocketchat-lib/server/functions/sendMessage.js # packages/rocketchat-theme/client/imports/general/base_old.css
@marceloschmidt Can you test it again? |
@RocketChat/core
Closes #6019