2 * @file miranda-groupchat.c
6 * Copyright (C) 2010-2018 SIPE Project <http://sipe.sourceforge.net/>
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
28 #include "newpluginapi.h"
29 #include "m_protosvc.h"
30 #include "m_protoint.h"
33 #include "sipe-backend.h"
34 #include "sipe-core.h"
35 #include "miranda-private.h"
37 void sipe_backend_groupchat_room_add(struct sipe_core_public
*sipe_public
,
40 const gchar
*description
,
44 SIPPROTO
*pr
= sipe_public
->backend_private
;
49 gs
.cbSize
= sizeof(gs
);
50 gs
.iType
= GCW_CHATROOM
;
51 gs
.pszModule
= pr
->proto
.m_szModuleName
;
54 gs
.pszStatusbarText
= description
;
58 if (CallServiceSync( MS_GC_NEWSESSION
, 0, (LPARAM
)&gs
))
60 SIPE_DEBUG_ERROR("sipe_backend_groupchat_room_add: Failed to create chat session <%d> <%s>", uri
, name
);
63 gcd
.pszModule
= pr
->proto
.m_szModuleName
;
66 gce
.cbSize
= sizeof(gce
);
69 gcd
.iType
= GC_EVENT_CONTROL
;
71 if (CallService( MS_GC_EVENT
, 0, (LPARAM
)&gce
))
73 SIPE_DEBUG_WARNING_NOFORMAT("sipe_backend_groupchat_room_add: Failed to add normal status to chat session");
76 gce
.pszStatus
= "Presenter";
77 if (CallService( MS_GC_EVENT
, 0, (LPARAM
)&gce
))
79 SIPE_DEBUG_WARNING_NOFORMAT("sipe_backend_groupchat_room_add: Failed to add presenter status to chat session");
83 gcd
.iType
= GC_EVENT_CONTROL
;
85 if (CallServiceSync( MS_GC_EVENT
, SESSION_INITDONE
, (LPARAM
)&gce
))
87 SIPE_DEBUG_WARNING_NOFORMAT("sipe_backend_groupchat_room_add: Failed to initdone chat session");
89 if (CallServiceSync( MS_GC_EVENT
, SESSION_ONLINE
, (LPARAM
)&gce
))
91 SIPE_DEBUG_ERROR_NOFORMAT("sipe_backend_groupchat_room_add: Failed to set chat session online\n");
96 void sipe_backend_groupchat_room_terminate(struct sipe_core_public
*sipe_public
)