On Saturday 20 June 2015 15:56:05 Joshua Joseph wrote:
> On Sat, Jun 20, 2015 at 4:38 PM, Pali Rohár <pali.ro...@gmail.com>
> wrote:
> > > I had not thought of that. :)
> > > 
> > > > Same for Contact: Does not it make sense to store
> > > > Kopete::Contact representing room? Or do you think it is not
> > > > needed at all?
> > > 
> > > Yes. I will change to Kopete::Contact.
> > 
> > I think you did not change anything, or yes?
> 
> Just changed the type column to int.
> 
> > Anyway detecting multi user
> > chat messages with that mutually exclusive condition (only one of
> > contact/session or name is set) is really hard to imagine and also
> > write correct select sql statement (it is even possible to write
> > optimal one for SQLite??). Rather use some multi user group chat
> > boolean column (in SQLite there is no boolean, just int).
> 
> LIke this?
> 

Still I do not know what description means... There is still information 
about "If in multi user mode..." and so on.

Also timestamp cannot be text.

> --messages table
> CREATE TABLE "messages" (
>    "id" Integer Primary Key Autoincrement Not Null, --Unique message
> identifier
>    "timestamp" Text, --When the message was handled
>    "message" Text, --HTML containing the message contents
>    "protocol" Text Not Null, --Protocol used
> (Kopete::Protocol::pluginId()) "account" Text Not Null, --Account
> used (Kopete::Account::accountId()) "direction" Integer Not Null,
> --(Inbound = 0, Outbound=1, Internal=2)
> (Kopete::Message::MessageDirection)
>    "importance" Integer, -- (Low, Normal, Highlight)
> (Kopete::Message) (Kopete::Message::MessageImportance)
>    "contact" Text, -- The local contact used in this message (if
> applicable). (Kopete::Contact::ContactId()). If present, we know we
> are in single user mode.
>    "subject" Text, --If applicable, this will store the subject of
> the message
>    "session" Text, -- Internal session identifier.
>    "session_name" Text, -- If in multi user mode, a human readable
> name for the session.
>    "from" Text, --Internal identifier for the message sender
>    "from_name" Text, --Human readable name of the message sender
>    "to" Text, --Internal identifier for the message recipient
>    "to_name" Text, --Human readable name of the message recipient.
>    "state" Integer, --(Unknown = 0, Sending = 1, Sent = 2, Error = 3)
>    "type" Integer, --The type of message. (TypeNormal, TypeAction,
> TypeFileTransferRequest, TypeVoiceClipRequest)
> (Kopete::Message::MessageType)
>    "is_group" Integer Default='0' --If this is set to 1, then we know
> we are in multi user mode.
>  )
> 
> > > > >    "session_name" Text, -- If in multi user mode, a human
> > > > >    readable name
> > > > 
> > > > for
> > > > 
> > > > > the session.
> > > > > 
> > > > >    "from" Text, --Internal identifier for the message sender
> > > > >    "from_name" Text, --Human readable name of the message
> > > > >    sender "to" Text, --Internal identifier for the message
> > > > >    recipient "to_name" Text, --Human readable name of the
> > > > >    message recipient.
> > > > 
> > > > Kopete::Message::from() and Kopete::Message::to() can represent
> > > > those from/to values...
> > > > 
> > > > Just to note that Kopete::Message::to() is list of
> > > > Kopete::Contact object. It is not single/one Kopete::Contact.
> > > > Maybe storing it as concatenation with ", " separator? Or
> > > > totally drop list and just store first Contact?
> > > 
> > > Its better to store all with a preset delimiter.
> > 
> > Ok. I think that most kopete protocols (maybe all now??) just set
> > one contact for Kopete::Message::to() value. So I think that in
> > future (when Kopete::Message will be ported to KF5) we could
> > change list to single value.
> > 
> > If you think that full list is needed, we can use delimiter and
> > maybe in future change it only to single value.
> 
> Noted.
> 

-- 
Pali Rohár
pali.ro...@gmail.com

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
kopete-devel mailing list
kopete-devel@kde.org
https://mail.kde.org/mailman/listinfo/kopete-devel

Reply via email to