Added ChatIdentity attachment to ContactCodeAdvert

This commit is contained in:
Samuel Hawksby-Robinson 2020-11-05 17:35:20 +00:00 committed by Andrea Maria Piana
parent 1f1e784d80
commit 48a34072bb
5 changed files with 153 additions and 72 deletions

View File

@ -5,6 +5,7 @@ import (
"database/sql"
"encoding/base64"
"encoding/json"
"errors"
)
type Database struct {
@ -100,6 +101,15 @@ func (d *Database) DeleteIdentityImage(it string) error {
return err
}
func (i IdentityImage) GetType() (ImageType, error) {
it := GetType(i.Payload)
if it == UNKNOWN {
return it, errors.New("unsupported file type")
}
return it, nil
}
func (i IdentityImage) GetDataURI() (string, error) {
mt, err := GetMimeType(i.Payload)
if err != nil {

View File

@ -14,8 +14,8 @@ const (
MaxJpegQuality = 80
MinJpegQuality = 50
smallDim = ResizeDimension(80)
largeDim = ResizeDimension(240)
SmallDim = ResizeDimension(80)
LargeDim = ResizeDimension(240)
smallDimName = "thumbnail"
largeDimName = "large"
@ -23,16 +23,16 @@ const (
var (
// ResizeDimensions list of all available image resize sizes
ResizeDimensions = []ResizeDimension{smallDim, largeDim}
ResizeDimensions = []ResizeDimension{SmallDim, LargeDim}
// DimensionSizeLimit the size limits imposed on each resize dimension
// Figures are based on the following sample data https://github.com/status-im/status-react/issues/11047#issuecomment-694970473
DimensionSizeLimit = map[ResizeDimension]DimensionLimits{
smallDim: {
SmallDim: {
Ideal: 2560, // Base on the largest sample image at quality 60% (2,554 bytes ∴ 1024 * 2.5)
Max: 5632, // Base on the largest sample image at quality 80% + 50% margin (3,683 bytes * 1.5 ≈ 5500 ∴ 1024 * 5.5)
},
largeDim: {
LargeDim: {
Ideal: 16384, // Base on the largest sample image at quality 60% (16,143 bytes ∴ 1024 * 16)
Max: 38400, // Base on the largest sample image at quality 80% + 50% margin (24,290 bytes * 1.5 ≈ 37500 ∴ 1024 * 37.5)
},
@ -40,14 +40,14 @@ var (
// ResizeDimensionToName maps a ResizeDimension to its assigned string name
ResizeDimensionToName = map[ResizeDimension]string{
smallDim: smallDimName,
largeDim: largeDimName,
SmallDim: smallDimName,
LargeDim: largeDimName,
}
// NameToResizeDimension maps a string name to its assigned ResizeDimension
NameToResizeDimension = map[string]ResizeDimension{
smallDimName: smallDim,
largeDimName: largeDim,
smallDimName: SmallDim,
largeDimName: LargeDim,
}
)

View File

@ -21,6 +21,7 @@ import (
"github.com/status-im/status-go/eth-node/crypto"
"github.com/status-im/status-go/eth-node/types"
enstypes "github.com/status-im/status-go/eth-node/types/ens"
userimage "github.com/status-im/status-go/images"
"github.com/status-im/status-go/protocol/audio"
"github.com/status-im/status-go/protocol/common"
"github.com/status-im/status-go/protocol/encryption"
@ -455,6 +456,11 @@ func (m *Messenger) handleSendContactCode() error {
m.logger.Error("could not build contact code advertisement", zap.Error(err))
}
err = m.handleContactCodeChatIdentity(contactCodeAdvertisement)
if err != nil {
return err
}
if contactCodeAdvertisement != nil {
payload, err = proto.Marshal(contactCodeAdvertisement)
if err != nil {
@ -477,6 +483,58 @@ func (m *Messenger) handleSendContactCode() error {
return err
}
// contactCodeAdvertisement attaches a protobuf.ChatIdentity to the given protobuf.ContactCodeAdvertisement,
// if the last time the ChatIdentity was attached was more than 24 hours ago
func (m *Messenger) handleContactCodeChatIdentity(cca *protobuf.ContactCodeAdvertisement) error {
pubKey := transport.PublicKeyToStr(&m.identity.PublicKey)
lp, err := m.persistence.GetWhenChatIdentityLastPublished(pubKey)
if err != nil {
return err
}
if *lp == 0 || *lp - time.Now().Unix() > 24 * 60 * 60{
err = m.attachChatIdentity(cca)
if err != nil {
return err
}
err := m.persistence.SaveWhenChatIdentityLastPublished(pubKey)
if err != nil {
return err
}
}
return nil
}
// attachChatIdentity
func (m *Messenger) attachChatIdentity(cca *protobuf.ContactCodeAdvertisement) error {
idb := userimage.NewDatabase(m.database)
imgs, err := idb.GetIdentityImages()
if err != nil {
return err
}
// Adapt images.IdentityImage to protobuf.IdentityImage
ciis := make(map[string]*protobuf.IdentityImage)
for _, img := range imgs {
ciis[img.Name] = &protobuf.IdentityImage{
Payload: img.Payload,
SourceType: protobuf.IdentityImage_RAW_PAYLOAD, // TODO add ENS avatar handling to dedicated PR
ImageType: images.ImageType(img.Payload),
}
}
cca.ChatIdentity = &protobuf.ChatIdentity{
Clock: m.transport.GetCurrentTime(),
EnsName: "", // TODO add ENS name handling to dedicate PR
Images: ciis,
}
return nil
}
// handleSharedSecrets process the negotiated secrets received from the encryption layer
func (m *Messenger) handleSharedSecrets(secrets []*sharedsecret.Secret) error {
var result []*transport.Filter

View File

@ -341,6 +341,7 @@ func (m *PushNotificationRegistrationResponse) GetRequestId() []byte {
type ContactCodeAdvertisement struct {
PushNotificationInfo []*PushNotificationQueryInfo `protobuf:"bytes,1,rep,name=push_notification_info,json=pushNotificationInfo,proto3" json:"push_notification_info,omitempty"`
ChatIdentity *ChatIdentity `protobuf:"bytes,2,opt,name=chat_identity,json=chatIdentity,proto3" json:"chat_identity,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
@ -378,6 +379,13 @@ func (m *ContactCodeAdvertisement) GetPushNotificationInfo() []*PushNotification
return nil
}
func (m *ContactCodeAdvertisement) GetChatIdentity() *ChatIdentity {
if m != nil {
return m.ChatIdentity
}
return nil
}
type PushNotificationQuery struct {
PublicKeys [][]byte `protobuf:"bytes,1,rep,name=public_keys,json=publicKeys,proto3" json:"public_keys,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
@ -825,68 +833,70 @@ func init() {
}
var fileDescriptor_200acd86044eaa5d = []byte{
// 1002 bytes of a gzipped FileDescriptorProto
// 1038 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x55, 0xdd, 0x6e, 0xe3, 0x44,
0x14, 0xc6, 0x4e, 0xda, 0x24, 0x27, 0x69, 0x9a, 0x8e, 0xfa, 0x63, 0x0a, 0x5d, 0x82, 0x01, 0x11,
0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e8, 0x8d, 0x6b, 0xd9, 0x8e, 0x79, 0x64, 0xf6, 0x7b, 0x4e, 0xca, 0x08,
0x92, 0x3a, 0xea, 0x50, 0xb9, 0x23, 0x0c, 0x21, 0x58, 0xa9, 0xba, 0xa5, 0xea, 0x31, 0x6c, 0xcf,
0x53, 0x9a, 0xe0, 0x25, 0xf4, 0x1d, 0x54, 0x25, 0x45, 0x31, 0x39, 0xf6, 0x9d, 0x25, 0x3c, 0x38,
0xb3, 0x7d, 0x62, 0xe2, 0xfa, 0x5f, 0x2a, 0xb4, 0xe7, 0x9f, 0x8c, 0x69, 0xc2, 0x97, 0x10, 0xf2,
0x0f, 0xf7, 0x09, 0x79, 0x6f, 0x19, 0x21, 0xa7, 0xa1, 0x16, 0x52, 0xf0, 0xff, 0x31, 0x7d, 0xfd,
0x97, 0xe7, 0x50, 0xf5, 0x3a, 0xd4, 0xdf, 0x62, 0xdb, 0x3a, 0x2e, 0x7e, 0xa7, 0x1e, 0x50, 0xae,
0x9a, 0x62, 0x96, 0xed, 0xb8, 0xd8, 0x38, 0x36, 0x47, 0x8e, 0x81, 0x8d, 0xc3, 0x56, 0x49, 0x9f,
0x80, 0x36, 0x5f, 0x90, 0x3c, 0xc1, 0xfb, 0x7d, 0x55, 0x1e, 0x5e, 0xd2, 0xf7, 0x50, 0x49, 0x44,
0xed, 0x4c, 0x53, 0xc5, 0xb4, 0x3a, 0x4f, 0x35, 0x09, 0xe7, 0x0e, 0xe7, 0xab, 0xc2, 0xf2, 0xdb,
0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0x30, 0x4e, 0x6f, 0x73, 0x17, 0x0a, 0x00, 0x00,
}

View File

@ -2,6 +2,8 @@ syntax = "proto3";
package protobuf;
import "chat_identity.proto";
message PushNotificationRegistration {
enum TokenType {
UNKNOWN_TOKEN_TYPE = 0;
@ -40,6 +42,7 @@ message PushNotificationRegistrationResponse {
message ContactCodeAdvertisement {
repeated PushNotificationQueryInfo push_notification_info = 1;
ChatIdentity chat_identity = 2;
}
message PushNotificationQuery {