File tree Expand file tree Collapse file tree 3 files changed +7
-5
lines changed Expand file tree Collapse file tree 3 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -32,8 +32,7 @@ export async function parseVCardResultStanza(iq) {
3232 image_type,
3333 image_hash : u . arrayBufferToHex ( ab ) ,
3434 } ) ;
35- }
36- else if ( image_url ) {
35+ } else if ( image_url ) {
3736 Object . assign ( result , {
3837 image_url,
3938 } ) ;
Original file line number Diff line number Diff line change @@ -46,7 +46,11 @@ export function onOccupantAvatarChanged(occupant) {
4646 vcards . push ( _converse . state . vcards . get ( occupant . get ( 'jid' ) ) ) ;
4747 }
4848 vcards . push ( _converse . state . vcards . get ( occupant . get ( 'from' ) ) ) ;
49- vcards . forEach ( ( v ) => ( hash || url ) && v && ( v ?. get ( 'image_hash' ) !== hash || v ?. get ( 'image_url' ) !== url ) && api . vcard . update ( v , true ) ) ;
49+ vcards . filter ( ( v ) => v ) . forEach ( ( v ) => {
50+ if ( hash && v . get ( 'image_hash' ) !== hash || url && v . get ( 'image_url' ) !== url ) {
51+ api . vcard . update ( v , true ) ;
52+ }
53+ } ) ;
5054}
5155
5256/**
Original file line number Diff line number Diff line change @@ -7,8 +7,7 @@ import { html, nothing } from 'lit';
77function getImgHref ( image , image_type ) {
88 if ( image . startsWith ( 'https:' ) || image . startsWith ( 'data:' ) ) {
99 return image ;
10- }
11- else {
10+ } else {
1211 return `data:${ image_type } ;base64,${ image } ` ;
1312 }
1413} ;
You can’t perform that action at this time.
0 commit comments