mirror of
https://github.com/status-im/matterbridge.git
synced 2025-01-20 19:18:57 +00:00
upgrade status-go to v0.56.6
Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
parent
30d56ffc2a
commit
0b3e12c300
@ -261,16 +261,16 @@ func (b *Bstatus) checkEnsNamesLoop() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (b *Bstatus) propagateMessage(msg *status.Message) {
|
func (b *Bstatus) propagateMessage(msg *status.Message) {
|
||||||
pubKey := publicKeyToHex(msg.SigPubKey)
|
|
||||||
var username string
|
var username string
|
||||||
|
var err error
|
||||||
// Contact can have an ENS Name, but needs to be verified
|
// Contact can have an ENS Name, but needs to be verified
|
||||||
contact, err := b.messenger.GetContactByID(pubKey)
|
contact := b.messenger.GetContactByID(msg.From)
|
||||||
if err != nil {
|
if contact == nil {
|
||||||
b.Log.WithError(err).Error("Not yet verified contact:", pubKey)
|
b.Log.Error("Not yet verified contact:", msg.From)
|
||||||
username, err = alias.GenerateFromPublicKeyString(pubKey)
|
username, err = alias.GenerateFromPublicKeyString(msg.From)
|
||||||
if err != nil { // fallback to full public key
|
if err != nil { // fallback to full public key
|
||||||
b.Log.WithError(err).Error("Failed to generate Chat name")
|
b.Log.WithError(err).Error("Failed to generate Chat name")
|
||||||
username = pubKey
|
username = msg.From
|
||||||
}
|
}
|
||||||
} else if contact.ENSVerified { // trim our domain for brevity
|
} else if contact.ENSVerified { // trim our domain for brevity
|
||||||
username = strings.TrimSuffix(contact.Name, ".stateofus.eth")
|
username = strings.TrimSuffix(contact.Name, ".stateofus.eth")
|
||||||
@ -285,7 +285,7 @@ func (b *Bstatus) propagateMessage(msg *status.Message) {
|
|||||||
b.Remote <- config.Message{
|
b.Remote <- config.Message{
|
||||||
Timestamp: time.Unix(int64(msg.WhisperTimestamp), 0),
|
Timestamp: time.Unix(int64(msg.WhisperTimestamp), 0),
|
||||||
Username: username,
|
Username: username,
|
||||||
UserID: pubKey,
|
UserID: msg.From,
|
||||||
Text: msg.Text,
|
Text: msg.Text,
|
||||||
Channel: msg.ChatId,
|
Channel: msg.ChatId,
|
||||||
ID: fmt.Sprintf("%#x", msg.ID),
|
ID: fmt.Sprintf("%#x", msg.ID),
|
||||||
@ -296,7 +296,7 @@ func (b *Bstatus) propagateMessage(msg *status.Message) {
|
|||||||
// skipStatusMessage defines which Status messages can be ignored
|
// skipStatusMessage defines which Status messages can be ignored
|
||||||
func (b *Bstatus) skipStatusMessage(msg *status.Message) bool {
|
func (b *Bstatus) skipStatusMessage(msg *status.Message) bool {
|
||||||
// skip messages from ourselves
|
// skip messages from ourselves
|
||||||
if isPubKeyEqual(msg.SigPubKey, &b.privateKey.PublicKey) {
|
if msg.From == publicKeyToHex(&b.privateKey.PublicKey) {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user