Android chat room developed based on XMPP smack openfire (7) [member status and status]

Source: Internet
Author: User

1. Chat is a member listener. Add it to muc.

/*** Chat room member listener ** @ author Liao naibo **/class myparticipant statuslistener implements maid {@ overridepublic void admingranted (string arg0) {log. I (TAG, "grant administrator permissions" + arg0) ;}@ overridepublic void adminrevoked (string arg0) {log. I (TAG, "Remove administrator permissions" + arg0) ;}@ overridepublic void banned (string arg0, string arg1, string arg2) {log. I (TAG, "do not join the room (pull black, do not know how to understand, haha)" + arg0);} @ overridepublic void joined (string arg0) {log. I (TAG, "the joined method is executed:" + arg0 + "added to the room"); // update the member getallmember (); android. OS. message MSG = new android. OS. message (); MSG. what = member; handler. sendmessage (MSG) ;}@ overridepublic void kicked (string arg0, string arg1, string arg2) {log. I (TAG, "" + arg0 + "") ;}@ overridepublic void left (string arg0) {string Lefter = arg0.substring (arg0.indexof ("/") + 1); log. I (TAG, "the left method is executed:" + Lefter + "left room"); // update the member getallmember (); android. OS. message MSG = new android. OS. message (); MSG. what = member; handler. sendmessage (MSG) ;}@ overridepublic void membershipgranted (string arg0) {log. I (TAG, "grant Member Permissions" + arg0) ;}@ overridepublic void membershiprevoked (string arg0) {log. I (TAG, "member permission removed" + arg0) ;}@ overridepublic void moderatorgranted (string arg0) {log. I (TAG, "Grant host Permissions" + arg0) ;}@ overridepublic void moderatorrevoked (string arg0) {log. I (TAG, "remove host permission" + arg0) ;}@ overridepublic void nicknamechanged (string arg0, string arg1) {log. I (TAG, "nickname changed" + arg0);} @ overridepublic void ownershipgranted (string arg0) {log. I (TAG, "Grant owner permission" + arg0) ;}@ overridepublic void ownershiprevoked (string arg0) {log. I (TAG, "Remove owner permission" + arg0) ;}@ overridepublic void voicegranted (string arg0) {log. I (TAG, "to" + arg0 + "authorized speech") ;}@ overridepublic void voicerevoked (string arg0) {log. I (TAG, "forbidden" + arg0 + "speak ");}}

2. Status Monitoring

Class myuserstatuslistener implements userstatuslistener {/* implement the default method here */}

 

"Source code 《《《《《《《《《《《《《

 

They are all the same. If you cannot understand them, you can translate them. If you are tired, go to bed first.

Related Article

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.