def event_PrivateMessage(self, main, text, fail_cb):

        osm = main.osm

        if len(text) > 1024:
            text = text[:1024-12] + ' [Truncated]'

        flags = 0

        ack_key = self.getPMAckKey()

        packet = ['PM']
        packet.append(osm.me.ipp)
        packet.append(ack_key)
        packet.append(osm.me.nickHash())
        packet.append(self.nickHash())
        packet.append(struct.pack('!BH', flags, len(text)))
        packet.append(text)
        packet = ''.join(packet)

        self.sendPrivateMessage(main.ph, ack_key, packet, fail_cb)