'Resend fragments
requires a ping done first to find missing fragments'

def resend_message(self, msg_id):

    if ((self.pending_msg_id == msg_id) and (msg_id in self.pending_messages.keys())):
        print '[+]    Found    saved    message,    only    resending    missing    fragments'
        for i in self.pending_messages[msg_id].keys():
            if (not self.pending_fragments[(i - 1)]):
                self.send_data(CMD_EXECUTE, self.pending_messages[msg_id][i], msg_id, i, len(self.pending_messages[msg_id].keys()))
            else:
                print 'Skipping', i
    elif (msg_id in self.pending_messages.keys()):
        print "[+]    Found    saved    message,    but    couldn't    find    ping    or    missing    fragments,    resending    everything"
        frag_count = len(self.pending_messages[msg_id].keys())
        for i in self.pending_messages[msg_id].keys():
            self.send_data(CMD_EXECUTE, self.pending_messages[msg_id][i], msg_id, i, frag_count)
    else:
        raise Exception(((("Couldn't    find    pending    message,    did    you    ping?    " + repr(msg_id)) + '    not    in    ') + str(self.pending_messages.keys())))
