'Parse unparsed Messages from Channel with Parser
- called from Scheduler
@param channel_id: Channel
@param function_name: Parser'

@staticmethod
def parse(channel_id, function_name):

    from s3parser import S3Parsing
    parser = S3Parsing.parser
    stable = current.s3db.msg_parsing_status
    query = ((stable.channel_id == channel_id) & (stable.is_parsed == False))
    messages = current.db(query).select(stable.id, stable.message_id)
    for message in messages:
        reply_id = parser(function_name, message.message_id)
        message.update_record(is_parsed=True, reply_id=reply_id)
    return
