3 | | Index: source/tools/XpartaMuPP/XpartaMuPP.py |
4 | | =================================================================== |
5 | | --- source/tools/XpartaMuPP/XpartaMuPP.py (revision 17144) |
6 | | +++ source/tools/XpartaMuPP/XpartaMuPP.py (working copy) |
7 | | @@ -577,10 +577,17 @@ class XpartaMuPP(sleekxmpp.ClientXMPP): |
8 | | break |
9 | | # Remove them from the local player list. |
10 | | self.lastLeft = str(presence['muc']['jid']) |
11 | | if str(presence['muc']['jid']) in self.nicks: |
12 | | del self.nicks[str(presence['muc']['jid'])] |
13 | | + # Try removing the game |
14 | | + try: |
15 | | + self.gameList.removeGame(presence['muc']['jid']) |
16 | | + self.sendGameList() |
17 | | + except: |
18 | | + traceback.print_exc() |
19 | | + logging.error("Failed to process game unregistration data") |
20 | | |
21 | | def muc_message(self, msg): |
22 | | """ |
23 | | Process new messages from the chatroom. |
24 | | """ |
| 3 | def muc_offline(self, presence): |
| 4 | """ |
| 5 | Process presence stanza from a chat room. |
| 6 | """ |
| 7 | # Clean up after a player leaves |
| 8 | if presence['muc']['nick'] != self.nick: |
| 9 | # Delete any games they were hosting. |
| 10 | for JID in self.gameList.getAllGames(): |
| 11 | if JID == str(presence['muc']['jid']): |
| 12 | self.gameList.removeGame(JID) |
| 13 | self.sendGameList() |
| 14 | break |
| 15 | # Remove them from the local player list. |
| 16 | self.lastLeft = str(presence['muc']['jid']) |
| 17 | if str(presence['muc']['jid']) in self.nicks: |
| 18 | del self.nicks[str(presence['muc']['jid'])] |