This repository was archived by the owner on Sep 11, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
src/components/views/groups Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ limitations under the License.
16
16
17
17
import React from 'react' ;
18
18
import PropTypes from 'prop-types' ;
19
+ import { MatrixClient } from 'matrix-js-sdk' ;
19
20
import sdk from '../../../index' ;
20
21
import dis from '../../../dispatcher' ;
21
22
import AccessibleButton from '../elements/AccessibleButton' ;
@@ -27,6 +28,10 @@ export default React.createClass({
27
28
group : PropTypes . object . isRequired ,
28
29
} ,
29
30
31
+ contextTypes : {
32
+ matrixClient : PropTypes . instanceOf ( MatrixClient ) ,
33
+ } ,
34
+
30
35
onClick : function ( e ) {
31
36
dis . dispatch ( {
32
37
action : 'view_group' ,
@@ -39,8 +44,10 @@ export default React.createClass({
39
44
const EmojiText = sdk . getComponent ( 'elements.EmojiText' ) ;
40
45
41
46
const groupName = this . props . group . name || this . props . group . groupId ;
47
+ const httpAvatarUrl = this . props . group . avatarUrl ?
48
+ this . context . matrixClient . mxcUrlToHttp ( this . props . group . avatarUrl , 24 , 24 ) : null ;
42
49
43
- const av = < BaseAvatar name = { groupName } width = { 24 } height = { 24 } url = { this . props . group . avatarUrl } /> ;
50
+ const av = < BaseAvatar name = { groupName } width = { 24 } height = { 24 } url = { httpAvatarUrl } /> ;
44
51
45
52
const label = < EmojiText
46
53
element = "div"
You can’t perform that action at this time.
0 commit comments