Feature #3594094: Add HTTPS to autodiscover probe
[siplcs.git] / src / miranda / miranda-groupchat.c
bloba3861094798a04e199b8464b7fdfedd335809802
1 /**
2 * @file miranda-groupchat.c
4 * pidgin-sipe
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
23 #ifdef HAVE_CONFIG_H
24 #include "config.h"
25 #endif
27 #include <windows.h>
28 #include <stdio.h>
30 #include <glib.h>
32 #include "newpluginapi.h"
33 #include "m_protosvc.h"
34 #include "m_protoint.h"
35 #include "m_chat.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,
42 const gchar *uri,
43 const gchar *name,
44 const gchar *description,
45 guint users,
46 guint32 flags)
48 SIPPROTO *pr = sipe_public->backend_private;
49 GCSESSION gs;
50 GCEVENT gce = {0};
51 GCDEST gcd = {0};
53 gs.cbSize = sizeof(gs);
54 gs.iType = GCW_CHATROOM;
55 gs.pszModule = pr->proto.m_szModuleName;
56 gs.pszName = name;
57 gs.pszID = uri;
58 gs.pszStatusbarText = description;
59 gs.dwFlags = 0;
60 gs.dwItemData = 0;
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;
68 gcd.pszID = uri;
70 gce.cbSize = sizeof(gce);
71 gce.pDest = &gcd;
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)
102 _NIF();
106 Local Variables:
107 mode: c
108 c-file-style: "bsd"
109 indent-tabs-mode: t
110 tab-width: 8
111 End: