sxiii / gtalksms

Automatically exported from code.google.com/p/gtalksms
0 stars 0 forks source link

Wrong name shown when sending message #20

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Send SMS via sms:<name>:<message>

What is the expected output?
The correct name of the contact.

What do you see instead?
The name of a contact whose name doesn't match the name given, nor the number 
displayed.

What version of the product are you using: v1.5

Please provide any additional information below.
The number displayed is the right one, it is just the name that is off. The 
correct person receives the SMS as well.

Original issue reported on code.google.com by Eckankar on 2 Jan 2011 at 6:15

Attachments:

GoogleCodeExporter commented 8 years ago
Do your contacts have the same phone number ? As a company number ?
Are they google contacts ?
Are they mobile phone number ?

Original comment by Florent....@gmail.com on 2 Jan 2011 at 6:52

GoogleCodeExporter commented 8 years ago
Jacob does not have a number. It shows him for every send.

He is a Facebook contact.

They are Google contacts with mobile numbers set.

Original comment by Eckankar on 2 Jan 2011 at 7:00

GoogleCodeExporter commented 8 years ago
Can you force contact sync in global parameters -> account & sync -> and 
uncheck and check every field contact for each account.
After sync is ok reboot your mobile.

It's a weird bug because the contact request works fine for me with the same 
configuration as you.

Original comment by Florent....@gmail.com on 2 Jan 2011 at 11:28

GoogleCodeExporter commented 8 years ago
Looking a bit at the source code, my guess as to the source of the bug would be:

ContactsManager.getContactName(Context, String) assumes that the String 
parameter is a phone number.

However, in MainService.java:506, setLastRecipient is called with a string 
which isn't a phone number (in my case) and sets _lastRecipient to this. This 
is in turn passed directly to getContactName.

The reason the message goes through and only the names fail is that the phone 
numbers are looked up through ContactsManager.getMatchingContacts, which 
performs the lookup in a different way altogether, while getContactName is used 
for finding the display name.

That'd be my guess, at least. Haven't done any proper debugging.

Original comment by Eckankar on 3 Jan 2011 at 12:07

GoogleCodeExporter commented 8 years ago
Correct, good catch, I'll commit a fix for the next version. But it's weird 
that getMachtingContact return a match in your case.

Original comment by Florent....@gmail.com on 3 Jan 2011 at 2:09

GoogleCodeExporter commented 8 years ago
It could possibly be because his mobile number is listed as "Askme".

Original comment by Eckankar on 3 Jan 2011 at 2:11

GoogleCodeExporter commented 8 years ago

Original comment by Florent....@gmail.com on 5 Jan 2011 at 8:42

GoogleCodeExporter commented 8 years ago
It hasn't completely fixed it.
The "Sending sms to XXX" message still is wrong.

Original comment by Eckankar on 6 Jan 2011 at 7:22

GoogleCodeExporter commented 8 years ago

Original comment by Florent....@gmail.com on 6 Jan 2011 at 8:48

GoogleCodeExporter commented 8 years ago
Is your phone number contact always set to "askme" ?
If you change it, does it fix your problem ?

Original comment by Florent....@gmail.com on 16 Jan 2011 at 12:46

GoogleCodeExporter commented 8 years ago
I'm a persistent bugger, so I'd rather find the bug than do a workaround. :)

ContactsManager:250, getContactName is called with contact.name, but it expects 
a phone number.

That'd explain how MainService:853 and MainService:857 gets a wrong name for 
phone.contactName.

Original comment by Eckankar on 16 Jan 2011 at 1:44

GoogleCodeExporter commented 8 years ago
oups I miss this one... I hope this time it's the good one!
Thanks for your help.

Fixed in next release.

Original comment by Florent....@gmail.com on 16 Jan 2011 at 3:05

GoogleCodeExporter commented 8 years ago
Fixed in 1.7.2

Original comment by Florent....@gmail.com on 16 Jan 2011 at 7:43

GoogleCodeExporter commented 8 years ago

Original comment by fschm...@gmail.com on 25 Aug 2011 at 7:51