Skip to content

Fix the "Someone" nickname problem (whatsapp) - #1931

Merged
42wim merged 6 commits into
42wim:masterfrom
ilmaisin:someonenick
Dec 14, 2022
Merged

Fix the "Someone" nickname problem (whatsapp)#1931
42wim merged 6 commits into
42wim:masterfrom
ilmaisin:someonenick

Conversation

@ilmaisin

@ilmaisin ilmaisin commented Nov 29, 2022

Copy link
Copy Markdown
Contributor

Fix #1876 and code cleanup

@ilmaisin ilmaisin changed the title Apply patch to work around the "Someone" nickname problem Apply patch to work around the "Someone" nickname problem (whatsapp) Nov 29, 2022
@ilmaisin

Copy link
Copy Markdown
Contributor Author

If i move

if AltName != "" {
	return AltName
}

to the place of

if sender.PushName != "" {
	return sender.PushName
}

the patch stops working.

if sender, exists := b.contacts[senderJid]; exists {
if sender.FullName != "" {
return sender.FullName
func (b *Bwhatsapp) getSenderName(info types.MessageInfo) string {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Method Bwhatsapp.getSenderName has a Cognitive Complexity of 21 (exceeds 20 allowed). Consider refactoring.

@ilmaisin

ilmaisin commented Dec 2, 2022

Copy link
Copy Markdown
Contributor Author

I have noticed that the getSenderName function does that FullName => PushName => FirstName query, but getSenderNotify just uses the PushName. Why?

@ilmaisin ilmaisin changed the title Apply patch to work around the "Someone" nickname problem (whatsapp) Fix the "Someone" nickname problem (whatsapp) Dec 2, 2022
@ilmaisin
ilmaisin marked this pull request as ready for review December 3, 2022 20:56
@ilmaisin
ilmaisin marked this pull request as draft December 6, 2022 22:25
@ilmaisin
ilmaisin marked this pull request as ready for review December 6, 2022 22:35
@qlty-cloud-legacy

Copy link
Copy Markdown

Code Climate has analyzed commit 2200a9c and detected 0 issues on this pull request.

View more on Code Climate.

@42wim 42wim added this to the 1.26.0 milestone Dec 14, 2022
@42wim
42wim merged commit 4cf313c into 42wim:master Dec 14, 2022
@42wim

42wim commented Dec 14, 2022

Copy link
Copy Markdown
Owner

Thanks!

selfhoster1312 pushed a commit to selfhoster1312/matterbridge that referenced this pull request Oct 10, 2025
* Apply patch to work around the "Someone" nickname problem

* Code cleanup (whatsapp)

* Cleanup

* Code cleanup (whatsapp)

* Re-examine if sender exists

* Cleanup (whatsapp)
weskerty pushed a commit to weskerty/AcopleBot that referenced this pull request Nov 30, 2025
* Apply patch to work around the "Someone" nickname problem

* Code cleanup (whatsapp)

* Cleanup

* Code cleanup (whatsapp)

* Re-examine if sender exists

* Cleanup (whatsapp)
wbonis pushed a commit to styliteag/matterbridge that referenced this pull request Feb 9, 2026
* Apply patch to work around the "Someone" nickname problem

* Code cleanup (whatsapp)

* Cleanup

* Code cleanup (whatsapp)

* Re-examine if sender exists

* Cleanup (whatsapp)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"Someone" instead of real nick when messaging from WhatsApp via web or desktop app (to Nextcloud Talk)

2 participants