From c0ff232a0112961b4d4e5aa29d6c7cab0664104b Mon Sep 17 00:00:00 2001 From: sje Date: Wed, 3 Oct 2007 08:30:12 +0000 Subject: send to send-offline-files-capable subcontact if we can't find an online file-send-capable one git-svn-id: https://server.scottellis.com.au/svn/mim_plugs@343 4f64403b-2f21-0410-a795-97e2b3489a10 --- meta2/proto.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'meta2/proto.cpp') diff --git a/meta2/proto.cpp b/meta2/proto.cpp index e0760b7..e507ca5 100644 --- a/meta2/proto.cpp +++ b/meta2/proto.cpp @@ -107,7 +107,7 @@ int ProtoGetInfo(WPARAM wParam,LPARAM lParam) { int ProtoGetAwayMsg(WPARAM wParam, LPARAM lParam) { CCSDATA *ccs = ( CCSDATA* )lParam; - ccs->hContact = Meta_GetMostOnline(ccs->hContact); + ccs->hContact = Meta_GetMostOnlineSupporting(ccs->hContact, PFLAGNUM_1, PF1_MODEMSGRECV); char *proto = ContactProto(ccs->hContact); if(!proto) return 0; @@ -170,6 +170,7 @@ int ProtoSendMessage(WPARAM wParam, LPARAM lParam) { if (ServiceExists(szTemp)) strncpy(szServiceName, PSS_MESSAGE "W", sizeof(szServiceName)); } + // subcontact does not support utf - convert to old ascii/wide format if((flags & PREF_UTF) && !(CallContactService(most_online, PS_GETCAPS, PFLAGNUM_4, 0) & PF4_IMSENDUTF)) { ccs->wParam &= ~PREF_UTF; ccs->wParam |= PREF_UNICODE; @@ -283,10 +284,8 @@ int ProtoFileSend(WPARAM wParam, LPARAM lParam) { // find the most online contact supporting file send, according to priorities HANDLE most_online = (HANDLE)Meta_GetMostOnlineSupporting(hMeta, PFLAGNUM_1, PF1_FILESEND); - TCHAR msg[1024], *proto; - mir_sntprintf(msg, 1024, _T("Diverting file send to subcontact: %s/%s"), ContactName(most_online), proto = mir_a2t(ContactProto(most_online))); - mir_free(proto); - PUShowMessageT(msg, SM_NOTIFY); + if(ContactStatus(most_online, ContactProto(most_online)) == ID_STATUS_OFFLINE) + most_online = (HANDLE)Meta_GetMostOnlineSupporting(hMeta, PFLAGNUM_4, PF4_OFFLINEFILES); int result = CallContactService(most_online, PSS_FILE, ccs->wParam, ccs->lParam); if(result != CALLSERVICE_NOTFOUND) return result; -- cgit v1.2.3