6 * Copyright (C) 2010-2015 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
27 #include "miranda-version.h"
28 #include "newpluginapi.h"
29 #include "m_protosvc.h"
30 #include "m_protoint.h"
31 #include "m_database.h"
33 #include "sipe-backend.h"
34 #include "sipe-core.h"
35 #include "miranda-private.h"
37 void sipe_backend_user_feedback_typing(struct sipe_core_public
*sipe_public
,
40 HANDLE hContact
= sipe_backend_buddy_find( sipe_public
, from
, NULL
);
45 CallService(MS_PROTO_CONTACTISTYPING
, (WPARAM
)hContact
, (LPARAM
)6);
48 void sipe_backend_user_feedback_typing_stop(struct sipe_core_public
*sipe_public
,
51 HANDLE hContact
= sipe_backend_buddy_find( sipe_public
, from
, NULL
);
56 CallService(MS_PROTO_CONTACTISTYPING
, (WPARAM
)hContact
, (LPARAM
)0);
59 void sipe_backend_user_ask(struct sipe_core_public
*sipe_public
,
61 const gchar
*accept_label
,
62 const gchar
*decline_label
,
68 void sipe_backend_user_close_ask(gpointer key
)
73 int sipe_miranda_SetAwayMsg(SIPPROTO
*pr
,
77 const gchar
*note
= TCHAR2CHAR(msg
);
79 SIPE_DEBUG_INFO("SetAwayMsg: status <%x> msg <%ls>", m_iStatus
, msg
);
80 sipe_miranda_setString(pr
, "note", note
);
82 if (pr
->state
== SIPE_MIRANDA_CONNECTED
)
83 sipe_core_status_set(pr
->sip
, FALSE
, MirandaStatusToSipe(pr
->proto
.m_iStatus
), note
);
88 int sipe_miranda_UserIsTyping( SIPPROTO
*pr
, HANDLE hContact
, int type
)
90 SIPE_DEBUG_INFO("type <%x>", type
);
96 if ( !DBGetContactSettingString( hContact
, pr
->proto
.m_szModuleName
, SIP_UNIQUEID
, &dbv
)) {
97 name
= g_strdup(dbv
.pszVal
);
104 case PROTOTYPE_SELFTYPING_ON
:
106 sipe_core_user_feedback_typing(pr
->sip
, name
, TRUE
);
111 case PROTOTYPE_SELFTYPING_OFF
:
112 /* Not supported anymore? */
114 sipe_core_user_feedback_typing(pr
->sip
, name
, FALSE
);