Commit c4367e7a authored by JC Brand's avatar JC Brand

Show own avatar

parent c12e361e
...@@ -4993,6 +4993,8 @@ body.reset { ...@@ -4993,6 +4993,8 @@ body.reset {
display: block; display: block;
text-align: center; text-align: center;
width: 100%; } width: 100%; }
#conversejs .avatar {
border-radius: 25%; }
#conversejs .activated { #conversejs .activated {
display: block !important; } display: block !important; }
#conversejs .pure-form-message { #conversejs .pure-form-message {
...@@ -5127,7 +5129,6 @@ body.reset { ...@@ -5127,7 +5129,6 @@ body.reset {
#converse-embedded-chat .chat-head .avatar, #converse-embedded-chat .chat-head .avatar,
#conversejs .chat-head .avatar { #conversejs .chat-head .avatar {
margin-right: 0.5em; margin-right: 0.5em;
border-radius: 25%;
float: left; } float: left; }
#converse-embedded-chat .chat-head .chatbox-buttons, #converse-embedded-chat .chat-head .chatbox-buttons,
#conversejs .chat-head .chatbox-buttons { #conversejs .chat-head .chatbox-buttons {
......
...@@ -4993,6 +4993,8 @@ body.reset { ...@@ -4993,6 +4993,8 @@ body.reset {
display: block; display: block;
text-align: center; text-align: center;
width: 100%; } width: 100%; }
#conversejs .avatar {
border-radius: 25%; }
#conversejs .activated { #conversejs .activated {
display: block !important; } display: block !important; }
#conversejs .pure-form-message { #conversejs .pure-form-message {
...@@ -5183,7 +5185,6 @@ body { ...@@ -5183,7 +5185,6 @@ body {
#converse-embedded-chat .chat-head .avatar, #converse-embedded-chat .chat-head .avatar,
#conversejs .chat-head .avatar { #conversejs .chat-head .avatar {
margin-right: 0.5em; margin-right: 0.5em;
border-radius: 25%;
float: left; } float: left; }
#converse-embedded-chat .chat-head .chatbox-buttons, #converse-embedded-chat .chat-head .chatbox-buttons,
#conversejs .chat-head .chatbox-buttons { #conversejs .chat-head .chatbox-buttons {
......
...@@ -33,7 +33,6 @@ ...@@ -33,7 +33,6 @@
.avatar { .avatar {
margin-right: 0.5em; margin-right: 0.5em;
border-radius: 25%;
float: left; float: left;
} }
......
...@@ -245,12 +245,18 @@ body.reset { ...@@ -245,12 +245,18 @@ body.reset {
width: 100%; width: 100%;
} }
.avatar {
border-radius: 25%;
}
.activated { .activated {
display: block !important; display: block !important;
} }
.pure-form-message { .pure-form-message {
padding: 0.5em 0; padding: 0.5em 0;
} }
.button-primary { .button-primary {
color: white; color: white;
background-color: $primary-color; background-color: $primary-color;
......
...@@ -46,9 +46,7 @@ ...@@ -46,9 +46,7 @@
}, },
initialize () { initialize () {
this.model.on("change:status", this.render, this); this.model.on("change", this.render, this);
this.model.on("change:status_message", this.render, this);
this.model.on("update-status-ui", this.render, this);
}, },
toHTML () { toHTML () {
......
...@@ -158,7 +158,7 @@ ...@@ -158,7 +158,7 @@
} }
}); });
_converse.on('chatBoxInitialized', function (chatbox) { _converse.on('chatBoxInitialized', (chatbox) => {
if (!_converse.use_vcards || chatbox.model.get('type') === 'headline') { if (!_converse.use_vcards || chatbox.model.get('type') === 'headline') {
return; return;
} }
...@@ -183,17 +183,15 @@ ...@@ -183,17 +183,15 @@
_converse.on('statusInitialized', function fetchOwnVCard () { _converse.on('statusInitialized', function fetchOwnVCard () {
if (_.isNil(_converse.xmppstatus.get('fullname'))) { if (_.isNil(_converse.xmppstatus.get('fullname'))) {
_converse.api.disco.supports(Strophe.NS.VCARD, _converse.domain).then( _converse.api.disco.supports(Strophe.NS.VCARD, _converse.domain)
(result) => { .then((result) => {
if (result.supported) { if (result.supported) {
_converse.api.vcard.get(_converse.bare_jid).then((vcard) => { _converse.api.vcard.get(_converse.bare_jid)
_converse.xmppstatus.save({'fullname': vcard.fullname || ''}); .then((vcard) => {
}); _converse.xmppstatus.save(vcard);
} });
} }})
).catch((msg) => { .catch(_.partial(_converse.log, _, Strophe.LogLevel.FATAL));
_converse.log(msg, Strophe.LogLevel.FATAL);
});
} }
}); });
......
<div class="userinfo"> <div class="userinfo">
<div class="d-flex"> <div class="d-flex">
<canvas height="20" width="20" class="avatar align-self-center"></canvas> <img alt="User Avatar" class="avatar align-self-center" height="40px" width="40px" src="data:{{{o.image_type}}};base64,{{{o.image}}}"/>
<span class="username w-100 align-self-center">{{{o.fullname}}}</span> <span class="username w-100 align-self-center">{{{o.fullname}}}</span>
<a class="chatbox-btn fa fa-vcard align-self-center" title="{{{o.title_your_profile}}}" data-toggle="modal" data-target="#userProfileModal"></a> <!-- <a class="chatbox-btn fa fa-vcard align-self-center" title="{{{o.title_your_profile}}}" data-toggle="modal" data-target="#userProfileModal"></a> -->
<a class="chatbox-btn fa fa-cog align-self-center" title="{{{o.title_change_status}}}" data-toggle="modal" data-target="#settingsModal"></a> <a class="chatbox-btn fa fa-cog align-self-center" title="{{{o.title_change_status}}}" data-toggle="modal" data-target="#settingsModal"></a>
</div> </div>
<div class="d-flex xmpp-status"> <div class="d-flex xmpp-status">
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment