core cleanup: move out ocs2005 code
[siplcs.git] / src / miranda / miranda-user.c
blob927f59efb184671d8bcda3ea1613415c9c707af9
1 /**
2 * @file miranda-user.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 #include <windows.h>
24 #include <stdio.h>
25 #include <glib.h>
27 #include "newpluginapi.h"
28 #include "m_protosvc.h"
29 #include "m_protoint.h"
31 #include "sipe-backend.h"
32 #include "sipe-core.h"
33 #include "sipe-core-private.h"
34 #include "miranda-private.h"
36 void sipe_backend_user_feedback_typing(struct sipe_core_public *sipe_public,
37 const gchar *from)
39 HANDLE hContact = sipe_backend_buddy_find( sipe_public, from, NULL );
41 if (!hContact)
42 return;
44 CallService(MS_PROTO_CONTACTISTYPING, (WPARAM)hContact, (LPARAM)6);
47 void sipe_backend_user_feedback_typing_stop(struct sipe_core_public *sipe_public,
48 const gchar *from)
50 HANDLE hContact = sipe_backend_buddy_find( sipe_public, from, NULL );
52 if (!hContact)
53 return;
55 CallService(MS_PROTO_CONTACTISTYPING, (WPARAM)hContact, (LPARAM)0);
58 void sipe_backend_user_ask(struct sipe_core_public *sipe_public,
59 const gchar *message,
60 const gchar *accept_label,
61 const gchar *decline_label,
62 gpointer key)
64 _NIF();
67 void sipe_backend_user_close_ask(gpointer key)
69 _NIF();
72 int sipe_miranda_SetAwayMsg(SIPPROTO *pr,
73 int m_iStatus,
74 const PROTOCHAR* msg)
76 const gchar *note = TCHAR2CHAR(msg);
78 SIPE_DEBUG_INFO("SetAwayMsg: status <%x> msg <%ls>", m_iStatus, msg);
79 sipe_miranda_setString(pr, "note", note);
80 LOCK;
81 if (pr->state == SIPE_MIRANDA_CONNECTED)
82 sipe_core_set_status(pr->sip, note, MirandaStatusToSipe(pr->proto.m_iStatus));
83 UNLOCK;
84 return 0;
89 Local Variables:
90 mode: c
91 c-file-style: "bsd"
92 indent-tabs-mode: t
93 tab-width: 8
94 End: