Release 1.25.0 -- Buddy Idle Time, RTF
[siplcs.git] / src / miranda / miranda-groupchat.c
blob28fba06879e2c3a3ae85d7e41548deb4264a0c95
1 /**
2 * @file miranda-groupchat.c
4 * pidgin-sipe
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
23 #include <windows.h>
24 #include <stdio.h>
26 #include <glib.h>
28 #include "newpluginapi.h"
29 #include "m_protosvc.h"
30 #include "m_protoint.h"
31 #include "m_chat.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,
38 const gchar *uri,
39 const gchar *name,
40 const gchar *description,
41 guint users,
42 guint32 flags)
44 SIPPROTO *pr = sipe_public->backend_private;
45 GCSESSION gs;
46 GCEVENT gce = {0};
47 GCDEST gcd = {0};
49 gs.cbSize = sizeof(gs);
50 gs.iType = GCW_CHATROOM;
51 gs.pszModule = pr->proto.m_szModuleName;
52 gs.pszName = name;
53 gs.pszID = uri;
54 gs.pszStatusbarText = description;
55 gs.dwFlags = 0;
56 gs.dwItemData = 0;
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;
64 gcd.pszID = uri;
66 gce.cbSize = sizeof(gce);
67 gce.pDest = &gcd;
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)
98 _NIF();
102 Local Variables:
103 mode: c
104 c-file-style: "bsd"
105 indent-tabs-mode: t
106 tab-width: 8
107 End: