Ejemplo n.º 1
0
def tag_recent_unread_mails(email_id,token,white_list, social_list=[], use_psync=False):
	# this will retrieve the all unread threads
	# now depending on the people involved in the thread other than the current
	# it will check mails only on the last 60 mins

	old_time = token_store.get_last_updated_time_stamp(email_id)
	now_time = token_store.set_last_updated_time_stamp(email_id,0)
	# now_time = helper.get_current_time_stamp()
	# print time.strftime("%D %H:%M", time.localtime(int(now_time)))

	tag_unread_mails_in_time_range(email_id,token,now_time,old_time,white_list, social_list, use_psync)
Ejemplo n.º 2
0
def tag_recent_unread_mails(email_id,
                            token,
                            white_list,
                            social_list=[],
                            use_psync=False):
    # this will retrieve the all unread threads
    # now depending on the people involved in the thread other than the current
    # it will check mails only on the last 60 mins

    old_time = token_store.get_last_updated_time_stamp(email_id)
    now_time = token_store.set_last_updated_time_stamp(email_id, 0)
    # now_time = helper.get_current_time_stamp()
    # print time.strftime("%D %H:%M", time.localtime(int(now_time)))

    tag_unread_mails_in_time_range(email_id, token, now_time, old_time,
                                   white_list, social_list, use_psync)
Ejemplo n.º 3
0
def get_deltas_to_push(email_id, token, all_delta_info_list, white_list):
	# print all_delta_info_list
	delta_info_list = filter(lambda x:x["unread"],all_delta_info_list)
	request_set = set([])
	for delta_info in delta_info_list:
		plist = delta_info["participants"]
		# print plist
		for participant in plist:
			request_set.add(participant["email"])
	score_dict = token_store.get_contact_score_list(email_id,list(request_set))
	blacklist = token_store.get_blacklist(email_id)
	old_time = token_store.get_last_updated_time_stamp(email_id)
	# print score_dict

	good_deltas = filter( lambda x:nylas_helper.is_object_important(x, blacklist, old_time, email_id, white_list,score_dict,[y['email'] for y in x['participants']]) , delta_info_list)
	# print good_deltas

	return good_deltas
Ejemplo n.º 4
0
def get_deltas_to_push(email_id, token, all_delta_info_list, white_list):
    # print all_delta_info_list
    delta_info_list = filter(lambda x: x["unread"], all_delta_info_list)
    request_set = set([])
    for delta_info in delta_info_list:
        plist = delta_info["participants"]
        # print plist
        for participant in plist:
            request_set.add(participant["email"])
    score_dict = token_store.get_contact_score_list(email_id,
                                                    list(request_set))
    blacklist = token_store.get_blacklist(email_id)
    old_time = token_store.get_last_updated_time_stamp(email_id)
    # print score_dict

    good_deltas = filter(
        lambda x: nylas_helper.is_object_important(
            x, blacklist, old_time, email_id, white_list, score_dict,
            [y['email'] for y in x['participants']]), delta_info_list)
    # print good_deltas

    return good_deltas