+ def sendMessage(self, text, noerror=False):
+ """ Used to send a mesage to the groupchat. Can be called immediately
+ after instantiation. """
+ if self.contactCount > 0:
+ SwitchboardSessionBase.sendMessage(self, text, noerror)
+ else:
+ #self.messageBuffer.append((message, noerror))
+ pass # They're sending messages to an empty room. Ignore.
+
+ def inviteUser(self, userHandle):
+ """ Used to invite a contact to the groupchat. Can be called immediately
+ after instantiation. """
+ userHandle = str(userHandle)
+ if self.ready:
+ LogEvent(INFO, self.ident, "immediate")
+ msn.SwitchboardClient.inviteUser(self, userHandle)
+ else:
+ LogEvent(INFO, self.ident, "pending")
+ self.funcBuffer.append(lambda: msn.SwitchboardClient.inviteUser(self, userHandle))
+
+ def gotMessage(self, message):
+ self.groupchat.gotMessage(message.userHandle, message.getMessage())
+
+ def userJoined(self, userHandle, screenName=''):
+ LogEvent(INFO, self.ident)
+ self.contactCount += 1
+ self.groupchat.contactJoined(userHandle)
+
+ def userLeft(self, userHandle):
+ LogEvent(INFO, self.ident)
+ self.contactCount -= 1
+ self.groupchat.contactLeft(userHandle)
+