summaryrefslogtreecommitdiffstats
path: root/bridge/config/config.go
diff options
context:
space:
mode:
authorWim <wim@42.be>2018-02-20 00:54:35 +0100
committerWim <wim@42.be>2018-02-20 01:15:25 +0100
commit7886f05e881e45303087a5ae116657f0f6164d81 (patch)
tree733afc4f86ee4a1995121f705164b62b14677338 /bridge/config/config.go
parentf58be0d1c1236a6a07a6917f3258a5608e1364f8 (diff)
downloadmatterbridge-msglm-7886f05e881e45303087a5ae116657f0f6164d81.tar.gz
matterbridge-msglm-7886f05e881e45303087a5ae116657f0f6164d81.tar.bz2
matterbridge-msglm-7886f05e881e45303087a5ae116657f0f6164d81.zip
Download (and upload) avatar images from mattermost and telegram when mediaserver is configured. Closes #362
An extra avatarMap (cache) is created for mattermost and telegram. If MediaServerUpload is configured, the avatar images of users are downloaded the first time a user sends a message. If this download succeeds a message with EVENT_AVATAR_DOWNLOAD is sent to the originating protocol. This message also contains a SHA field (in msg.Extra["file"]), if this is not empty, the sha will be added to the avatarMap. (so we now have a userid-sha cache) Next time this user sends a message, the MediaServerUpload/sha/userid.png URL will be used as the avatar field.
Diffstat (limited to 'bridge/config/config.go')
-rw-r--r--bridge/config/config.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/bridge/config/config.go b/bridge/config/config.go
index 1cf0b9f5..c5d4f543 100644
--- a/bridge/config/config.go
+++ b/bridge/config/config.go
@@ -14,6 +14,7 @@ const (
EVENT_TOPIC_CHANGE = "topic_change"
EVENT_FAILURE = "failure"
EVENT_FILE_FAILURE_SIZE = "file_failure_size"
+ EVENT_AVATAR_DOWNLOAD = "avatar_download"
EVENT_REJOIN_CHANNELS = "rejoin_channels"
EVENT_USER_ACTION = "user_action"
EVENT_MSG_DELETE = "msg_delete"