summaryrefslogtreecommitdiff
path: root/protocols/FacebookRM
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/FacebookRM')
-rw-r--r--protocols/FacebookRM/src/proto.cpp4
-rw-r--r--protocols/FacebookRM/src/theme.cpp45
2 files changed, 19 insertions, 30 deletions
diff --git a/protocols/FacebookRM/src/proto.cpp b/protocols/FacebookRM/src/proto.cpp
index 13d816fac3..df22c38441 100644
--- a/protocols/FacebookRM/src/proto.cpp
+++ b/protocols/FacebookRM/src/proto.cpp
@@ -67,10 +67,6 @@ FacebookProto::FacebookProto(const char* proto_name, const TCHAR* username) :
CreateProtoService(PS_JOINCHAT, &FacebookProto::OnJoinChat);
CreateProtoService(PS_LEAVECHAT, &FacebookProto::OnLeaveChat);
- CreateProtoService("/Mind", &FacebookProto::OnMind);
- CreateProtoService("/VisitProfile", &FacebookProto::VisitProfile);
- CreateProtoService("/VisitNotifications", &FacebookProto::VisitNotifications);
-
HookProtoEvent(ME_CLIST_PREBUILDSTATUSMENU, &FacebookProto::OnBuildStatusMenu);
HookProtoEvent(ME_OPT_INITIALISE, &FacebookProto::OnOptionsInit);
HookProtoEvent(ME_IDLE_CHANGED, &FacebookProto::OnIdleChanged);
diff --git a/protocols/FacebookRM/src/theme.cpp b/protocols/FacebookRM/src/theme.cpp
index ecb6403495..88e8d3ded4 100644
--- a/protocols/FacebookRM/src/theme.cpp
+++ b/protocols/FacebookRM/src/theme.cpp
@@ -208,13 +208,6 @@ int FacebookProto::OnPrebuildContactMenu(WPARAM wParam, LPARAM)
int FacebookProto::OnBuildStatusMenu(WPARAM, LPARAM)
{
- char text[200];
- mir_strncpy(text, m_szModuleName, 100);
- char *tDest = text + mir_strlen(text);
-
- CLISTMENUITEM mi = { 0 };
- mi.pszService = text;
-
HGENMENU hRoot = Menu_GetProtocolRoot(m_szModuleName);
if (hRoot == NULL) {
CLISTMENUITEM miRoot = { 0 };
@@ -231,49 +224,49 @@ int FacebookProto::OnBuildStatusMenu(WPARAM, LPARAM)
}
}
+ CLISTMENUITEM mi = { 0 };
mi.flags = (this->isOnline() ? 0 : CMIF_GRAYED);
mi.position = 201001;
mi.hParentMenu = hRoot;
- //CreateProtoService(m_szModuleName,"/Mind",&FacebookProto::OnMind,this);
- mir_strcpy(tDest, "/Mind");
+ mi.pszService = "/Mind";
+ CreateProtoService(mi.pszService, &FacebookProto::OnMind);
mi.name.a = LPGEN("Share status...");
mi.icolibItem = GetIconHandle("mind");
- m_hStatusMind = Menu_AddProtoMenuItem(&mi);
+ m_hStatusMind = Menu_AddProtoMenuItem(&mi, m_szModuleName);
- //CreateProtoService("/VisitProfile",&FacebookProto::VisitProfile);
- mir_strcpy(tDest, "/VisitProfile");
+ mi.pszService = "/VisitProfile";
+ CreateProtoService(mi.pszService, &FacebookProto::VisitProfile);
mi.name.a = LPGEN("Visit profile");
mi.icolibItem = Skin_GetIconHandle(SKINICON_EVENT_URL);
- // TODO RM: remember and properly free in destructor?
- /*m_hStatusMind = */Menu_AddProtoMenuItem(&mi);
+ Menu_AddProtoMenuItem(&mi, m_szModuleName);
- //CreateProtoService("/VisitNotifications", &FacebookProto::VisitNotifications);
- mir_strcpy(tDest, "/VisitNotifications");
+ mi.pszService = "/VisitNotifications";
+ CreateProtoService(mi.pszService, &FacebookProto::VisitNotifications);
mi.name.a = LPGEN("Visit notifications");
mi.icolibItem = Skin_GetIconHandle(SKINICON_EVENT_URL);
- Menu_AddProtoMenuItem(&mi);
+ Menu_AddProtoMenuItem(&mi, m_szModuleName);
// Services...
mi.hParentMenu = m_hMenuServicesRoot = Menu_CreateRoot(MO_PROTO, LPGENT("Services..."), mi.position, Skin_GetIconHandle(SKINICON_OTHER_HELP));
- CreateProtoService("/RefreshBuddyList", &FacebookProto::RefreshBuddyList);
- mir_strcpy(tDest, "/RefreshBuddyList");
+ mi.pszService = "/RefreshBuddyList";
+ CreateProtoService(mi.pszService, &FacebookProto::RefreshBuddyList);
mi.name.a = LPGEN("Refresh Buddy List");
mi.icolibItem = GetIconHandle("friendship");
- Menu_AddProtoMenuItem(&mi);
+ Menu_AddProtoMenuItem(&mi, m_szModuleName);
- CreateProtoService("/CheckFriendRequests", &FacebookProto::CheckFriendRequests);
- mir_strcpy(tDest, "/CheckFriendRequests");
+ mi.pszService = "/CheckFriendRequests";
+ CreateProtoService(mi.pszService, &FacebookProto::CheckFriendRequests);
mi.name.a = LPGEN("Check Friends Requests");
mi.icolibItem = Skin_GetIconHandle(SKINICON_AUTH_REQUEST);
- Menu_AddProtoMenuItem(&mi);
+ Menu_AddProtoMenuItem(&mi, m_szModuleName);
- CreateProtoService("/CheckNewsfeeds", &FacebookProto::CheckNewsfeeds);
- mir_strcpy(tDest, "/CheckNewsfeeds");
+ mi.pszService = "/CheckNewsfeeds";
+ CreateProtoService(mi.pszService, &FacebookProto::CheckNewsfeeds);
mi.name.a = LPGEN("Check Newsfeeds");
mi.icolibItem = GetIconHandle("newsfeed");
- Menu_AddProtoMenuItem(&mi);
+ Menu_AddProtoMenuItem(&mi, m_szModuleName);
return 0;
}