~fnux/telegram-tl-elixir

0e603ae7d2e65d29efd45b670f22e8a8656b99a7 — Timothée Floure 4 years ago 532a398
Use 2^index when parsing flags
1 files changed, 2 insertions(+), 1 deletions(-)

M lib/tl/parse.ex
M lib/tl/parse.ex => lib/tl/parse.ex +2 -1
@@ 79,8 79,9 @@ defmodule TL.Parse do
        ~r/^flags.(\d)\?(.*)$/ui, type
      )
      index = String.to_integer(index)
      pow_index = :math.pow(2, index) |> round

      if (index != 0 && Bitwise.band(flags, index) == index) do
      if (index != 0 && Bitwise.band(flags, pow_index) == pow_index) do
        processed_params ++ [%{"name" => name, "type" => wrapped_type}]
      else
        processed_params