diff --git a/static/js/services/buddylist.js b/static/js/services/buddylist.js index 0c77771f..7280ccfc 100644 --- a/static/js/services/buddylist.js +++ b/static/js/services/buddylist.js @@ -325,8 +325,7 @@ define(['underscore', 'modernizr', 'avltree', 'text!partials/buddy.html', 'text! } if (url.indexOf("img:") === 0) { - url = url.substr(4); - status.buddyPicture = status.buddyPictureLocalUrl = mediaStream.config.B + "static/img/buddy/s46/"+url; + status.buddyPicture = status.buddyPictureLocalUrl = mediaStream.url.buddy(url.substr(4)); } }; diff --git a/static/js/services/mediastream.js b/static/js/services/mediastream.js index e12ac363..dfdfb2a3 100644 --- a/static/js/services/mediastream.js +++ b/static/js/services/mediastream.js @@ -69,6 +69,9 @@ define([ id = $window.encodeURIComponent(id); return $window.location.protocol+'//'+$window.location.host+context.Cfg.B+id; }, + buddy: function(id) { + return $window.location.protocol+'//'+$window.location.host+context.Cfg.B+"static/img/buddy/s46/"+id; + }, api: function(path) { return (context.Cfg.B || "/") + "api/v1/" + path; }