func (b *Bmattermost) cacheAvatar(msg *config.Message) (string, error) {
    fi := msg.Extra["file"][0].(config.FileInfo)
    /* if we have a sha we have successfully uploaded the file to the media server,
    so we can now cache the sha */
    if fi.SHA != "" {