Miranda NG Official Community Forum

Forum for English speaking Miranda NG users => Miranda NG general talk => Topic started by: wismerhil on 20 01 2015, 07:57:33

Title: How to place messages in the chat?
Post by: wismerhil on 20 01 2015, 07:57:33
Hello.
Please tell me how to add incoming/outgoing messages in chat? In principle, with the incoming I figured out a method db_event_add. In General please tell me how to put incoming/outgoing chat messages.
Title: Re: How to place messages in the chat?
Post by: Robyer on 21 01 2015, 05:06:34
In case you're talking about classic conversations (with 1 user):

In Facebook protocol I use combination of ProtoChainRecvMsg() protocol method for new unread incomming messages, and db_event_add() for messages sent from other instances.
See http://trac.miranda-ng.org/browser/trunk/protocols/FacebookRM/src/process.cpp#L788

Sent messages from Miranda are added automatically by StdMsg/Scriver/TabSRMM plugin... You get info about user sending message in SendMsg() protocol method.
See http://trac.miranda-ng.org/browser/trunk/protocols/FacebookRM/src/messages.cpp#L114


In case you're talking about group chats (aka IRC/Jabber chatrooms or other multiuser conversations):

These events are not saved into database. For using chats you should see m_chat.h API where you can also understand how to add new events (= messages, etc.) into log.
See http://trac.miranda-ng.org/browser/trunk/include/m_chat.h