Just spotted an Elixir trick I haven't seen before

def visible_for_user?(%{__struct__: module} = message, user)
when module in [Activity, Object] do


now that's a neat way to match on both struct types