'get chat ids for `usernames`, `fullnames` & `groups`.
entries with a matching chat ids will be removed from the input lists.
:type session: sqlalchemy.orm.Session
:type usernames: list[str]
:type fullnames: list[tuple[str, str]]
:type groups: list[str]
:returns: chat ids, new chat ids found?
:rtype: list[ChatIdEntry], bool'

def _get_chat_ids(self, session, usernames, fullnames, groups):

    self.log.debug(u'loading    cached    chat    ids')
    chat_ids = self._get_cached_chat_ids(session, usernames, fullnames, groups)
    self.log.debug(u'found    {0}    cached    chat_ids:    {1}'.format(len(chat_ids), [u'{0}'.format(x) for x in chat_ids]))
    if (not (usernames or fullnames or groups)):
        self.log.debug(u'all    chat    ids    found    in    cache')
        return (chat_ids, False)
    self.log.debug(u'loading    new    chat    ids')
    new_chat_ids = list(self._get_new_chat_ids(usernames, fullnames, groups))
    self.log.debug(u'found    {0}    new    chat_ids:    {1}'.format(len(new_chat_ids), [u'{0}'.format(x) for x in new_chat_ids]))
    chat_ids.extend(new_chat_ids)
    return (chat_ids, bool(new_chat_ids))
