Merge pull request #680 from Mikunj/bug-fix

Fix minor profile picture bugs.
pull/693/head
Mikunj Varsani 6 years ago committed by GitHub
commit eb03adf704
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1061,8 +1061,9 @@ MessageReceiver.prototype.extend({
const primaryConversation = ConversationController.get( const primaryConversation = ConversationController.get(
primaryDevicePubKey primaryDevicePubKey
); );
// if (profile) {
this.updateProfile(primaryConversation, profile, profileKey); this.updateProfile(primaryConversation, profile, profileKey);
}
} }
const ev = new Event('sent'); const ev = new Event('sent');

@ -145,17 +145,17 @@ Message.prototype = {
proto.profileKey = this.profileKey; proto.profileKey = this.profileKey;
} }
// Only send the display name for now. // Set the loki profile
// In the future we might want to extend this to send other things. if (this.profile) {
if (this.profile && this.profile.displayName) {
const profile = new textsecure.protobuf.DataMessage.LokiProfile(); const profile = new textsecure.protobuf.DataMessage.LokiProfile();
profile.displayName = this.profile.displayName; if (this.profile.displayName) {
profile.displayName = this.profile.displayName;
}
const conversation = window.ConversationController.get( const conversation = window.ConversationController.get(
textsecure.storage.user.getNumber() textsecure.storage.user.getNumber()
); );
const avatarPointer = conversation.get('avatarPointer'); const avatarPointer = conversation.get('avatarPointer');
if (avatarPointer) { if (avatarPointer) {
profile.avatar = avatarPointer; profile.avatar = avatarPointer;
} }

Loading…
Cancel
Save