Openfire-Spark Add the default Contact Group to Chinese

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.