File tree Expand file tree Collapse file tree 2 files changed +3
-25
lines changed
Expand file tree Collapse file tree 2 files changed +3
-25
lines changed Original file line number Diff line number Diff line change @@ -126,31 +126,6 @@ class WebhookBridge {
126126 */
127127 _updateBotProfile ( ) {
128128 return ;
129- LogService . info ( "WebhookBridge" , "Updating appearance of bridge bot" ) ;
130-
131- const desiredDisplayName = this . _config . webhookBot . appearance . displayName || "Webhook Bridge" ;
132- const desiredAvatarUrl = this . _config . webhookBot . appearance . avatar_url || "http://i.imgur.com/IDOBtEJ.png" ; // webhook icon
133-
134- const botIntent = this . getBotIntent ( ) ;
135-
136- WebhookStore . getAccountData ( 'bridge' ) . then ( botProfile => {
137- let avatar_url = botProfile . avatar_url ;
138- if ( ! avatar_url || avatar_url !== desiredAvatarUrl ) {
139- util . uploadContentFromUrl ( this . _bridge , desiredAvatarUrl , botIntent ) . then ( mxcUrl => {
140- LogService . verbose ( "WebhookBridge" , "Avatar MXC URL = " + mxcUrl ) ;
141- LogService . info ( "WebhookBridge" , "Updating avatar for bridge bot" ) ;
142- botIntent . setAvatarUrl ( mxcUrl ) ;
143- botProfile . avatar_url = desiredAvatarUrl ;
144- WebhookStore . setAccountData ( 'bridge' , botProfile ) ;
145- } ) ;
146- }
147- botIntent . getProfileInfo ( this . _bridge . getBot ( ) . getUserId ( ) , 'displayname' ) . then ( profile => {
148- if ( profile . displayname != desiredDisplayName ) {
149- LogService . info ( "WebhookBridge" , "Updating display name from '" + profile . displayname + "' to '" + desiredDisplayName + "'" ) ;
150- botIntent . setDisplayName ( desiredDisplayName ) ;
151- }
152- } ) ;
153- } ) ;
154129 }
155130
156131 /**
Original file line number Diff line number Diff line change 11module . exports = ( webhook , matrix ) => {
22 if ( ! matrix . sender . avatar_url && webhook . avatar_url )
33 matrix . sender . avatar_url = webhook . avatar_url ;
4+
5+ if ( ! matrix . sender . avatar_url && webhook . avatarUrl )
6+ matrix . sender . avatar_url = webhook . avatarUrl ;
47} ;
You can’t perform that action at this time.
0 commit comments