-
Rick, thank you for reporting the problem, You are correct. Tigase intentionally makes sure the name attribute is not empty. This is because historically, many XMPP/Jabber client did not handle well empty or non-existed name attribute of the roster item.
I am not sure what is the current state of this problem on current XMPP clients but I would prefer to keep current implementation as default for time being, however we will change behavior to have an option to allow for empty roster element names.
Type |
Bug
|
Priority |
Minor
|
Assignee | |
RedmineID |
2118
|
Version |
tigase-server-7.1.0
|
Spent time |
0
|
Issue Votes (0)
Watchers (0)
Hi:
I am not very sure if it is a problem.Below is test case:
Precondition:
There are two user:user1 and user2.
Test step:
1.user1 add roster:user1 add user2 as his contact:
request:
response:
2.user1 update roster:change the name of user2 to empty:
request:
response:
See,the contact's name is still "user2" other than expeced empty.
There are this sentence in RFC6121(http://xmpp.org/rfcs/rfc6121.html#roster-update):_Implementation Note: Including an empty 'name' attribute is equivalent to including no 'name' attribute; both actions set the name to the empty string._
So I think if user want to modify his contact name to empty,tigase server should also push empty name rather than "previous name".
I also have found the reason of this issue(if it is):In RosterFlat#addBuddy(XMPPResourceConnection, JID, String, String[], String) about line 191:
The relem is cached in memory of session scope.It's retrived in RosterFlat#getUserRoster(XMPPResourceConnection):roster = (Map<BareJID, RosterElement>) session.getCommonSessionData(ROSTER) and updated in RosterFlat#saveUserRoster(XMPPResourceConnection):session.setData(null, ROSTER, sb.toString());
If name in request of updating roster is empty,relem won't set the name to empty and previous name would be sent to client.