Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions client/changelog_en-US.txt
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ FIXES

- The country selector for pairing by phone number now lists every country and territory WhatsApp supports (the Netherlands, Kenya, Belarus and North Macedonia, among others, were missing), and country names are now shown in your chosen language for Polish, Turkish and Romanian too.

- Verified WhatsApp Business accounts (banks, payment apps, utilities) that you have not saved as contacts showed only their phone number in the chat list. They now show the business's verified name, as in WhatsApp. A name saved in your contacts still takes precedence.

V2.0.0.0

The big news in this release is calls: you can now place, answer and reject voice and video calls from WinZapp itself, without picking up your phone, with an accessible call window, keyboard shortcuts, dedicated audio settings and your call history in the new Calls tab. Locked chats, search in archived chats, Turkish and Romanian and several usability improvements arrived too, along with fixes for situations where WinZapp asked you to pair again when it did not need to. Under the hood, the program's code went through a major reorganization: it changes nothing in how you use WinZapp, but it makes it easier to maintain and to fix from here on.
Expand Down
2 changes: 2 additions & 0 deletions client/changelog_es-ES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ CORRECCIONES

- El selector de país del emparejamiento por número de teléfono ahora incluye todos los países y territorios que admite WhatsApp (faltaban, por ejemplo, los Países Bajos, Kenia, Bielorrusia y Macedonia del Norte), y los nombres de los países también se muestran en el idioma elegido para polaco, turco y rumano.

- Las cuentas de empresa verificadas de WhatsApp (bancos, aplicaciones de pago, compañías de servicios) que no tienes guardadas en contactos aparecían en la lista de chats solo con el número de teléfono. Ahora aparecen con el nombre verificado de la empresa, como en WhatsApp. Un nombre guardado en tus contactos sigue teniendo prioridad.

V2.0.0.0

La gran novedad de esta versión son las llamadas: ahora se pueden hacer, contestar y rechazar llamadas de voz y videollamadas desde el propio WinZapp, sin coger el móvil, con una ventana de llamada accesible, atajos de teclado, configuración de audio propia y el historial en la nueva pestaña Llamadas. También llegan los chats bloqueados, la búsqueda en las conversaciones archivadas, los idiomas turco y rumano y varias mejoras de uso, además de correcciones en situaciones en las que WinZapp pedía vincular de nuevo sin necesidad. Por dentro, el código del programa ha pasado por una gran reorganización: no cambia nada en el uso, pero hace que WinZapp sea más fácil de mantener y de corregir a partir de ahora.
Expand Down
2 changes: 2 additions & 0 deletions client/changelog_pl.txt
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ POPRAWKI

- Lista wyboru kraju przy parowaniu przez numer telefonu zawiera teraz wszystkie kraje i terytoria obsługiwane przez WhatsApp (brakowało m.in. Holandii, Kenii, Białorusi i Macedonii Północnej), a nazwy krajów są wyświetlane w wybranym języku także po polsku, turecku i rumuńsku.

- Zweryfikowane konta firmowe WhatsApp (banki, aplikacje płatnicze, dostawcy usług), których nie masz zapisanych w kontaktach, były widoczne na liście czatów tylko z numerem telefonu. Teraz pokazują zweryfikowaną nazwę firmy, tak jak w WhatsApp. Nazwa zapisana w kontaktach nadal ma pierwszeństwo.

V2.0.0.0

Najważniejszą nowością tej wersji są połączenia: połączenia głosowe i wideo można teraz nawiązywać, odbierać i odrzucać bezpośrednio w WinZapp, bez sięgania po telefon — z dostępnym oknem połączenia, skrótami klawiszowymi, własnymi ustawieniami dźwięku i historią w nowej karcie Połączenia. Doszły też zabezpieczone czaty, wyszukiwanie w zarchiwizowanych czatach, języki turecki i rumuński oraz kilka usprawnień w obsłudze, a także poprawki sytuacji, w których WinZapp niepotrzebnie prosił o ponowne parowanie. Pod spodem kod programu przeszedł dużą reorganizację: niczego nie zmienia w codziennym używaniu, ale sprawia, że WinZapp będzie łatwiej utrzymywać i naprawiać.
Expand Down
2 changes: 2 additions & 0 deletions client/changelog_pt-BR.txt
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ CORREÇÕES

- Na seleção de país do pareamento por número de telefone, a lista agora contém todos os países e territórios que o WhatsApp aceita (faltavam, por exemplo, Países Baixos, Quênia, Belarus e Macedônia do Norte), e os nomes dos países aparecem no idioma escolhido também em polonês, turco e romeno.

- Contas comerciais verificadas do WhatsApp (bancos, aplicativos de pagamento, concessionárias) que você não salvou nos contatos apareciam na lista de conversas só com o número de telefone. Agora aparecem com o nome verificado da empresa, como no WhatsApp. Um nome salvo nos seus contatos continua tendo preferência.

V2.0.0.0

A grande novidade desta versão são as ligações: agora dá para ligar, atender e recusar ligações de voz e de vídeo pelo próprio WinZapp, sem pegar o celular, com uma janela de ligação acessível, atalhos de teclado, configurações de áudio próprias e o histórico na nova aba Ligações. Também chegaram as conversas trancadas, a pesquisa nas conversas arquivadas, os idiomas turco e romeno e várias melhorias de uso, além de correções em situações em que o WinZapp pedia para parear de novo sem necessidade. Por baixo, o código do programa passou por uma grande reorganização: ela não muda nada no uso, mas deixa o WinZapp mais fácil de manter e de corrigir daqui para a frente.
Expand Down
2 changes: 2 additions & 0 deletions client/changelog_pt-PT.txt
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ CORREÇÕES

- Na seleção de país do emparelhamento por número de telefone, a lista passa a conter todos os países e territórios que o WhatsApp aceita (faltavam, por exemplo, os Países Baixos, o Quénia, a Bielorrússia e a Macedónia do Norte), e os nomes dos países aparecem no idioma escolhido também em polaco, turco e romeno.

- Contas comerciais verificadas do WhatsApp (bancos, aplicações de pagamento, empresas de serviços) que não guardou nos contactos apareciam na lista de conversas só com o número de telefone. Agora aparecem com o nome verificado da empresa, como no WhatsApp. Um nome guardado nos seus contactos continua a ter preferência.

V2.0.0.0

A grande novidade desta versão são as chamadas: agora é possível fazer, atender e recusar chamadas de voz e de vídeo no próprio WinZapp, sem pegar no telemóvel, com uma janela de chamada acessível, atalhos de teclado, definições de áudio próprias e o histórico no novo separador Chamadas. Chegaram também as conversas trancadas, a pesquisa nas conversas arquivadas, os idiomas turco e romeno e várias melhorias de utilização, além de correções em situações em que o WinZapp pedia para emparelhar de novo sem necessidade. Por baixo, o código do programa passou por uma grande reorganização: não muda nada na utilização, mas torna o WinZapp mais fácil de manter e de corrigir daqui para a frente.
Expand Down
2 changes: 2 additions & 0 deletions client/changelog_ro.txt
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ CORECTĂRI

- Lista de țări de la asocierea prin număr de telefon conține acum toate țările și teritoriile acceptate de WhatsApp (lipseau, de exemplu, Țările de Jos, Kenya, Belarus și Macedonia de Nord), iar numele țărilor apar în limba aleasă și pentru poloneză, turcă și română.

- Conturile business WhatsApp verificate (bănci, aplicații de plată, furnizori de utilități) pe care nu le-ați salvat în contacte apăreau în lista de conversații doar cu numărul de telefon. Acum apar cu numele verificat al companiei, ca în WhatsApp. Un nume salvat în contacte are în continuare prioritate.

V2.0.0.0

Marea noutate a acestei versiuni sunt apelurile: acum puteți iniția, prelua și respinge apeluri vocale și video direct din WinZapp, fără să luați telefonul, cu o fereastră de apel accesibilă, comenzi rapide de la tastatură, setări audio proprii și istoricul în noua filă, Apeluri. Alte noutăți apărute: conversațiile blocate, căutarea în conversațiile arhivate, limbile turcă și română și mai multe îmbunătățiri de utilizare, precum și corecții pentru situațiile în care WinZapp cerea o nouă asociere fără să fie nevoie. În spate, codul programului a trecut printr-o reorganizare amplă: nu schimbă nimic în utilizare, dar face WinZapp mai ușor de întreținut și de corectat de acum înainte.
Expand Down
2 changes: 2 additions & 0 deletions client/changelog_tr-TR.txt
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ DÜZELTMELER

- Telefon numarasıyla eşleştirmede ülke seçimi artık WhatsApp'ın desteklediği tüm ülke ve bölgeleri içeriyor (Hollanda, Kenya, Belarus ve Kuzey Makedonya gibi ülkeler eksikti) ve ülke adları Lehçe, Türkçe ve Rumence için de seçilen dilde gösteriliyor.

- Kişilerinize kaydetmediğiniz doğrulanmış WhatsApp Business hesapları (bankalar, ödeme uygulamaları, hizmet şirketleri) sohbet listesinde yalnızca telefon numarasıyla görünüyordu. Artık WhatsApp'ta olduğu gibi işletmenin doğrulanmış adıyla görünür. Kişilerinizde kayıtlı bir ad yine önceliklidir.

V2.0.0.0

Bu sürümün en büyük yeniliği aramalardır: Telefona ihtiyaç duymadan doğrudan WinZapp üzerinden sesli ve görüntülü arama başlatabilir, gelen aramaları yanıtlayabilir veya reddedebilirsiniz. Bu yenilik; tam erişilebilir bir arama penceresi, pratik klavye kısayolları, aramalara özel ses ayarları ve yeni Aramalar sekmesindeki kapsamlı arama geçmişiyle birlikte sunulmaktadır. Ayrıca PIN korumalı kilitli sohbetler, arşivlenmiş sohbetlerde arama, resmi Türkçe ve Rumence dil destekleri ile çeşitli kullanım iyileştirmeleri eklendi; WinZapp'in gereksiz yere yeniden eşleştirme istediği durumlar da düzeltildi. Arka planda programın kod tabanı büyük bir yeniden yapılandırmadan (refactoring) geçti: Bu durum WinZapp'i kullanım şeklinizde hiçbir şeyi değiştirmez; ancak programın uzun vadeli kararlılığını, bakımını ve hata düzeltme süreçlerini önemli ölçüde kolaylaştırır.
Expand Down
19 changes: 18 additions & 1 deletion client/main_window/chats_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -524,14 +524,31 @@ def _lift_contact_identity(chat: dict) -> None:
so lastMessage is empty for all of them) and no unread count was
dropped from the conversation list entirely.

A verified WhatsApp Business account (banks, payment apps, utilities)
is a second gap in the same mechanism: it sets no personal `pushname`,
so name/shortName/pushname all came up empty and the chat was listed
as a bare phone number. WhatsApp's own client shows the business's
verified name, which WPPConnect serialises as `contact.verifiedName`;
it is the last fallback for `name`, after the address-book name and
shortName. Seen live on accounts such as "99 Pay" and "Verisure
Brasil".

Never overwrites a value the chat already carries — the top-level keys
win when both are present. Mutates `chat` in place.
"""
contact_obj = chat.get("contact")
if not isinstance(contact_obj, dict):
return
if not (chat.get("name") or "").strip():
cname = (contact_obj.get("name") or contact_obj.get("shortName") or "").strip()
# The first non-blank one: a whitespace-only name must not hide
# the verified name behind it.
cname = next(
(value.strip()
for value in (contact_obj.get(key)
for key in ("name", "shortName", "verifiedName"))
if isinstance(value, str) and value.strip()),
"",
)
if cname:
chat["name"] = cname
if not (chat.get("pushName") or "").strip():
Expand Down
80 changes: 80 additions & 0 deletions tests/test_chat_identity.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,36 @@ def test_accepts_either_pushname_spelling(self):
lift(chat)
assert chat["pushName"] == "Zé"

def test_falls_back_to_the_verified_business_name(self):
"""A verified WhatsApp Business account (a bank, a payment app, a
utility) sets no personal pushname: name, shortName and pushname all
arrive empty and only contact.verifiedName carries the name
WhatsApp's own client shows."""
chat = {"contact": {"verifiedName": "99 Pay", "isBusiness": True}}
lift(chat)
assert chat["name"] == "99 Pay"
assert "pushName" not in chat

def test_name_and_short_name_still_win_over_the_verified_name(self):
chat = {"contact": {"name": "Meu Apelido", "verifiedName": "99 Pay"}}
lift(chat)
assert chat["name"] == "Meu Apelido"
chat = {"contact": {"shortName": "Apelido", "verifiedName": "99 Pay"}}
lift(chat)
assert chat["name"] == "Apelido"

@pytest.mark.parametrize("blank", ["name", "shortName"])
def test_a_blank_address_book_name_does_not_hide_the_verified_name(self, blank):
chat = {"contact": {blank: " ", "verifiedName": "99 Pay"}}
lift(chat)
assert chat["name"] == "99 Pay"

@pytest.mark.parametrize("bad", [None, 42, " ", {"x": 1}])
def test_a_missing_or_malformed_verified_name_is_ignored(self, bad):
chat = {"contact": {"verifiedName": bad}}
lift(chat)
assert "name" not in chat

def test_never_overwrites_an_existing_top_level_name(self):
chat = {"name": "Apelido meu", "contact": {"name": "Nome do contato"}}
lift(chat)
Expand Down Expand Up @@ -117,3 +147,53 @@ def test_raw_name_still_wins_when_present(self):

def test_group_name_still_counts(self):
assert _keeps_chat(**self._base(group_name="Equipe WinZapp")) is True


class _ResolverStub:
"""Just what the real _resolve_contact_name() reads, for a chat whose
number is not in the address book."""

_resolve_contact_name = MainWindow._resolve_contact_name
_is_bad_contact_name = staticmethod(MainWindow._is_bad_contact_name)

def __init__(self, contacts=None):
self.contacts = contacts or {}
self._presence_pushname_map = {}
self._phone_to_lid = {}
self._lid_to_phone = {}

def _get_contact_tolerant(self, jid):
return self.contacts.get(jid)

def _find_alt_jid_from_messages(self, chat):
return ""


class TestNotInTheAddressBook:
"""The list shows a name instead of the phone number for a number that
was never saved: the verified name of a business, or the name a person
chose for their own WhatsApp profile. These pin the lift and the real
resolver together, so either regressing turns those rows back into
numbers."""

JID = "552123919910@s.whatsapp.net"

def test_a_verified_business_is_named_by_the_resolver(self):
chat = {"remoteJid": self.JID, "contact": {"verifiedName": "99 Pay"}}
lift(chat)
assert _ResolverStub()._resolve_contact_name(chat) == "99 Pay"

def test_an_address_book_name_still_wins_over_the_verified_name(self):
chat = {"remoteJid": self.JID, "contact": {"verifiedName": "99 Pay"}}
lift(chat)
stub = _ResolverStub({self.JID: {"name": "Carteira digital"}})
assert stub._resolve_contact_name(chat) == "Carteira digital"

def test_a_person_s_profile_name_is_lifted_for_the_list(self):
"""Nothing in the address book; the chat list then uses
chat["pushName"], which the lift fills from the contact's own
WhatsApp profile name."""
chat = {"remoteJid": "5511999999999@s.whatsapp.net",
"contact": {"pushname": "Maria da Padaria"}}
lift(chat)
assert chat["pushName"] == "Maria da Padaria"
Loading