'Combine the message\'s flags and keywords using the mapping for the
destination folder.'

def combine_flags_and_keywords(self, uid, dstfolder):

    selfflags = set(self.getmessageflags(uid))
    try:
        keywordmap = dstfolder.getrepository().getkeywordmap()
        if (keywordmap is None):
            return selfflags
        knownkeywords = set(keywordmap.keys())
        selfkeywords = self.getmessagekeywords(uid)
        if (not (knownkeywords >= selfkeywords)):
            skipped_keywords = list((selfkeywords - knownkeywords))
            selfkeywords &= knownkeywords
            self.ui.warn(('Unknown    keywords    skipped:    %s\nYou    may    want    to    change    your    configuration    to    include    those\n' % skipped_keywords))
        keywordletterset = set([keywordmap[keyw] for keyw in selfkeywords])
        selfflags |= keywordletterset
    except NotImplementedError:
        pass
    return selfflags
