processone / xmpp

Erlang/Elixir XMPP parsing and serialization library on top of Fast XML
http://process-one.net
Apache License 2.0
137 stars 88 forks source link

error while encoding #muc_subscription record #31

Closed ltAldoRaine closed 6 years ago

ltAldoRaine commented 6 years ago

I want to return extra attribute when user retrieves subscribed groups.

I added new column in muc_room_subscribers, and changed

?SQL("select @(room)s from muc_room_subscribers where jid=%(JidS)s"
         " and host=%(Host)s")

with this

?SQL("select @(room)s, @(unread)s from muc_room_subscribers where jid=%(JidS)s"
         " and host=%(Host)s")

and

[jid:make(Room, Host, <<>>) || {Room} <- Subs]; with this

[#muc_subscription{jid = jid:make(Room, Host, <<>>)), unread = binary_to_integer(Unread)} || {Room, Unread} <- Subs]; Also i changed xmpp_spec file and transfer new p1_mucsub.erl to ejabebrd deps/xmpp/src directory

i think i'm doing everything right, but when i retrieve subscribed groups i get this error.

image

ltAldoRaine commented 6 years ago

@zinid

zinid commented 6 years ago

wut?

ltAldoRaine commented 6 years ago

can you help me ?