Created
February 28, 2016 17:09
-
-
Save CharlesOkwuagwu/14a204edb867ef82ed9d to your computer and use it in GitHub Desktop.
too many warnings
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defp send_messages(msg_list, s, do_timer_reset) do | |
if do_timer_reset do | |
if s.acks != [] do | |
ids = s.acks | |
s = %{s | acks: []} | |
log "adding acks: #{inspect ids}" | |
msg_list = msg_list ++ [{TL.msgs_ack(ids), false}] | |
end | |
# if s.resends != [] do | |
# ids = s.resends | |
# s = %{s | resends: []} | |
# log "adding resends: #{inspect ids}" | |
# msg_list = msg_list ++ [{TL.msg_resend_req(ids), false}] | |
# end | |
:timer.cancel(s.ack_timer) | |
end | |
if length(msg_list) > 1 do | |
{content_count, prev_msg_id, msg} = pack_messages(msg_list, 0, "", s.content_count, s.prev_msg_id) | |
send_enc(seq_no(content_count, false), message_id(prev_msg_id + 8), content_count, msg, s) | |
else | |
{msg, is_content} = hd(msg_list) | |
if is_content == true do | |
send_enc(seq_no(s.content_count, true), message_id(s.prev_msg_id + 8), s.content_count + 1, msg, s) | |
else | |
send_enc(seq_no(s.content_count, false), message_id(s.prev_msg_id + 8), s.content_count, msg, s) | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
No more warnings, and I guess it's a bit cleaner :)