def check_msg(self):
        Log.debug("checking msg for %s" % self._userid)
        msgbox = MsgBox.MsgBox(self._userid)
        msg_count = msgbox.GetMsgCount(all = False)
        my_pid = os.getpid()
        xmpp_read = self.rosters.get_xmpp_read(self._user.GetUID())
        if xmpp_read > msg_count:
            xmpp_read = 0
        Log.debug("total: %d xmpp read: %d" % (msg_count, xmpp_read))
        self.rosters.set_xmpp_read(self._user.GetUID(), msg_count)
        if xmpp_read < msg_count:
            return xmpp_read
        else:
            return -1
dataset/ETHPy150Open HenryHu/pybbs/xmppserver.py/XMPPServer.check_msg/original