Subscription status table

Brad Fitzpatrick brad at danga.com
Fri Jul 7 17:02:17 UTC 2006


substates doesn't exist as a table, but basically there are 4 subscription
status (state) flags on a roster group item:

   in
   out
   pend_in
   pent_out

Those can be collapsed into a number, which is what
DJabberd::Subscription.pm does.  (object <-> number <-> object)

In your rosterstorage class, just store the number provided to you, and
provide it back, and DJabberd will do the right thing.



On Fri, 7 Jul 2006, Guillermo Roditi wrote:

> I am trying to write a wroster class and I was looking in sqllite
> roster storage. i came accross this, which im still wrapping my head
> around since everything seems to be a jidmap entry. anyways, i guess
> my question boils down to, what the hell is substates and where is the
> definition for it?
>
> i just ran accross hookdocs.pm which is making my life a lot less
> miserable, but this one is still outstanding
>
> CREATE TABLE jidmap (
>               jidid INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
>               jid   VARCHAR(255) NOT NULL,
>               UNIQUE (jid)
>              )
>
> CREATE TABLE roster (
>               userid        INTEGER REFERENCES jidmap NOT NULL,
>               contactid     INTEGER REFERENCES jidmap NOT NULL,
>               name          VARCHAR(255),
>               subscription  INTEGER NOT NULL REFERENCES substates DEFAULT 0,
>               PRIMARY KEY (userid, contactid)
>              )
>
> CREATE TABLE rostergroup (
>               groupid       INTEGER PRIMARY KEY REFERENCES jidmap NOT NULL,
>               userid        INTEGER REFERENCES jidmap NOT NULL,
>               name          VARCHAR(255),
>               UNIQUE (userid, name)
>              )
>
> CREATE TABLE groupitem (
>               groupid       INTEGER REFERENCES jidmap NOT NULL,
>               contactid     INTEGER REFERENCES jidmap NOT NULL,
>               PRIMARY KEY (groupid, contactid)
>              )
>
>


More information about the Djabberd mailing list