2 * @file miranda-groupchat.c
6 * Copyright (C) 2010-11 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
32 #include "newpluginapi.h"
33 #include "m_protosvc.h"
34 #include "m_protoint.h"
37 #include "sipe-backend.h"
38 #include "sipe-core.h"
39 #include "miranda-private.h"
41 void sipe_backend_groupchat_room_add(struct sipe_core_public
*sipe_public
,
44 const gchar
*description
,
48 SIPPROTO
*pr
= sipe_public
->backend_private
;
53 gs
.cbSize
= sizeof(gs
);
54 gs
.iType
= GCW_CHATROOM
;
55 gs
.pszModule
= pr
->proto
.m_szModuleName
;
58 gs
.pszStatusbarText
= description
;
62 if (CallServiceSync( MS_GC_NEWSESSION
, 0, (LPARAM
)&gs
))
64 SIPE_DEBUG_ERROR("sipe_backend_groupchat_room_add: Failed to create chat session <%d> <%s>", uri
, name
);
67 gcd
.pszModule
= pr
->proto
.m_szModuleName
;
70 gce
.cbSize
= sizeof(gce
);
73 gcd
.iType
= GC_EVENT_CONTROL
;
75 if (CallService( MS_GC_EVENT
, 0, (LPARAM
)&gce
))
77 SIPE_DEBUG_WARNING_NOFORMAT("sipe_backend_groupchat_room_add: Failed to add normal status to chat session");
80 gce
.pszStatus
= "Presenter";
81 if (CallService( MS_GC_EVENT
, 0, (LPARAM
)&gce
))
83 SIPE_DEBUG_WARNING_NOFORMAT("sipe_backend_groupchat_room_add: Failed to add presenter status to chat session");
87 gcd
.iType
= GC_EVENT_CONTROL
;
89 if (CallServiceSync( MS_GC_EVENT
, SESSION_INITDONE
, (LPARAM
)&gce
))
91 SIPE_DEBUG_WARNING_NOFORMAT("sipe_backend_groupchat_room_add: Failed to initdone chat session");
93 if (CallServiceSync( MS_GC_EVENT
, SESSION_ONLINE
, (LPARAM
)&gce
))
95 SIPE_DEBUG_ERROR_NOFORMAT("sipe_backend_groupchat_room_add: Failed to set chat session online\n");
100 void sipe_backend_groupchat_room_terminate(struct sipe_core_public
*sipe_public
)