Chat-O-Matic/application/AppMessages.h
Jaidyn Ann 4905dbbe6c Redesign add-on disconnection
Currently, add-ons are disconnected when ChatProtocol::Shutdown() is
called, which the add-on can do by itself― but there is no standard way
for add-ons to notify the app about their Shutdown. Because of this,
they tend to not call Shutdown()― instead (as in the case of the Jabber
add-on), they display a BAlert (IM_ERROR) notifying the user of the
connection error, but the account is considered active by Cardie (and
its threads are still existant, including its ProtocolLooper).

Zombies are bad, so this is redesigned somewhat with this commit:
Protocols should no longer call ChatProtocol::Shutdown() themselves,
they must send an IM_MESSAGE of IM_PROTOCOL_DISABLE to the app.

This will delete its ProtocolLooper, which in turn will send a
notification to the user and delete the ChatProtocol, and so
calling ChatProtocol::Shutdown().

In the included protocols, an IM_ERROR is sent right before
IM_PROTOCOL_DISABLE is sent if due to a connection error. This is not
required, but it is courteous to inform your user about the "why." :)
2021-07-18 17:52:36 -05:00

63 lines
1.4 KiB
C

/*
* Copyright 2010-2011, Pier Luigi Fiorini. All rights reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef _APP_MESSAGES_H
#define _APP_MESSAGES_H
//! Show settings window
const uint32 APP_SHOW_SETTINGS = 'RPST';
//! Open chat window
const uint32 APP_OPEN_CHAT_WINDOW = 'CYow';
//! Close chat window
const uint32 APP_CLOSE_CHAT_WINDOW = 'CYcw';
//! Chat messages
const uint32 APP_CHAT = 'CYch';
//! Create a new chat
const uint32 APP_NEW_CHAT = 'CYnc';
//! Create a new chat
const uint32 APP_NEW_ROOM = 'CYnr';
//! Join a chat
const uint32 APP_JOIN_ROOM = 'CYjr';
//! Invite user to current chat
const uint32 APP_SEND_INVITE = 'CYin';
//! Send replicant's messenger to the app
const uint32 APP_REPLICANT_MESSENGER = 'RPme';
//! Status notification from the replicant
const uint32 APP_REPLICANT_STATUS_SET = 'RPMS';
//! Exit notification from replicant
const uint32 APP_REPLICANT_EXIT = 'RPEX';
//! Show main window replicant notification
const uint32 APP_REPLICANT_SHOW_WINDOW = 'CYSW';
//! Select the upward conversation
const uint32 APP_MOVE_UP = 'CYmu';
//! Select the downward conversation
const uint32 APP_MOVE_DOWN = 'CYmd';
//! Disable a given account
const uint32 APP_ACCOUNT_DISABLED = 'CYda';
//! Request a "help" message
const uint32 APP_REQUEST_HELP = 'CYhm';
//! Display a "user info" window
const uint32 APP_USER_INFO = 'CYuw';
//! Edit the contact roster
const uint32 APP_EDIT_ROSTER = 'CYer';
#endif // _APP_MESSAGES_H