We are using Openfire 4.0.3 for chat communication in our API application. Openfire is maintaining one database for chat purpose.
In that database there is ofRoster table which stores the users and their contact list.
The structure of table is:
CREATE TABLE [dbo].[ofRoster](
[rosterID] [int] NOT NULL,
[username] nvarchar NOT NULL,
[jid] nvarchar NOT NULL,
[sub] [int] NOT NULL,
[ask] [int] NOT NULL,
[recv] [int] NOT NULL,
[nick] nvarchar NULL)
I am unable to understand the clear purpose of sub, ask and recv fields. When we add a contact to the user, it is randomly selecting the values for sub, ask and recv.
So far I have seen possible values :
Sub = 0 - None, 1= To, 2 = From, 3 = Both, -1 = remove
ask= -1 ?, 0= subscribe, 1= ?
Moreover, the contact disappears from the contact list of user when the roster table has a combination (0,-1,-1) for (sub,ask,recv). This is the primary issue i am investigating. Could anybody please help me understand in what case we will have this combination in the database amd whether it is per design that the user should not be displayed in the contact list if he has such combination.
Your quick response is highly appreciated.