Openfire has powerful functions and various internationalization functions, but we often cannot use such internationalization. Sometimes we need to modify the source code to support only our own things. However, this is also a lazy practice. Not much. There are a lot of theories.
1. Requirements:
When adding contacts in spark, the default group name is "friends". We need to change it to Chinese characters such as "My friends.
2. Implementation Method:
(1) Search "friends" globally in the project, expand all the result sets, and find the two files:
The code in openfire can not be modified. It is not listed here.
Spark Project:
(2) Change these "friends" to the text you want, such as "friends ".
(3) Delete the local spark file. The win7 system directory is c: \ Users \ Administrator \ appdata \ roaming \ spark.
(4) It is best to refresh the server cache.
(5) tip: This method is only valid for the first time you add a contact. That is, if this contact has established a Friends contact, it will not overwrite friends. Adding a contact again will not be added to the modified group. The principle is as follows:
3. Principle:
The user's contacts and contact groups are associated with the database tables ofroster and ofrostergroup. You can view the database and find that the group information is not saved in the database. When a contact is added for the first time, a series of queries are performed to check whether the user in the database has added a contact and local files. If the user already has information about the group, the query is directly read, if not, initialize the information of the place where the code is modified in the previous article.
The above is my understanding of spark and openfire source code. You are welcome to correct it.