diff --git a/modules/phone/_default/client.lua b/modules/phone/_default/client.lua index b05bde5..bd3d2fe 100644 --- a/modules/phone/_default/client.lua +++ b/modules/phone/_default/client.lua @@ -1,6 +1,17 @@ +---@diagnostic disable: duplicate-set-field Phone = Phone or {} ----@diagnostic disable-next-line: duplicate-set-field +---This will get the name of the Phone system being being used. +---@return string +Phone.GetPhoneName = function() + return 'default' +end + +---This will send an email to the passed email address with the title and message. +---@param email string +---@param title string +---@param message string +---@return boolean Phone.SendEmail = function(email, title, message) return false, Print.Error('There Is No Phone Bridged.') end diff --git a/modules/phone/_default/server.lua b/modules/phone/_default/server.lua index 899d30e..01bb488 100644 --- a/modules/phone/_default/server.lua +++ b/modules/phone/_default/server.lua @@ -1,11 +1,25 @@ +---@diagnostic disable: duplicate-set-field Phone = Phone or {} ----@diagnostic disable-next-line: duplicate-set-field +---This will get the name of the Phone system being being used. +---@return string +Phone.GetPhoneName = function() + return 'default' +end + +---This will get the phone number of the passed source. +---@param src number +---@return number|boolean Phone.GetPlayerPhone = function(src) return false, Print.Error('There Is No Phone Bridged.') end ----@diagnostic disable-next-line: duplicate-set-field +---This will send an email to the passed source, email address, title and message. +---@param src number +---@param email string +---@param title string +---@param message string +---@return boolean Phone.SendEmail = function(src, email, title, message) return false, Print.Error('There Is No Phone Bridged.') end diff --git a/modules/phone/gksphone/client.lua b/modules/phone/gksphone/client.lua index 8b1e62d..f253028 100644 --- a/modules/phone/gksphone/client.lua +++ b/modules/phone/gksphone/client.lua @@ -1,14 +1,20 @@ +---@diagnostic disable: duplicate-set-field local resourceName = "gksphone" if GetResourceState(resourceName) == 'missing' then return end Phone = Phone or {} ----comment +---This will get the name of the Phone system being being used. +---@return string +Phone.GetPhoneName = function() + return resourceName +end + +---This will send an email to the passed email address with the title and message. ---@param email string ---@param title string ---@param message string ---@return boolean ----@diagnostic disable-next-line: duplicate-set-field Phone.SendEmail = function(email, title, message) return exports["gksphone"]:SendNewMail({ sender = email, image = '/html/static/img/icons/mail.png', subject = title, message = message }) end diff --git a/modules/phone/gksphone/server.lua b/modules/phone/gksphone/server.lua index f00ae9c..4efc6db 100644 --- a/modules/phone/gksphone/server.lua +++ b/modules/phone/gksphone/server.lua @@ -1,22 +1,27 @@ +---@diagnostic disable: duplicate-set-field local resourceName = "gksphone" if GetResourceState(resourceName) == 'missing' then return end Phone = Phone or {} ----comment +---This will get the name of the Phone system being being used. +---@return string +Phone.GetPhoneName = function() + return resourceName +end + +---This will get the phone number of the passed source. ---@param src number ----@return number| boolean ----@diagnostic disable-next-line: duplicate-set-field +---@return number|boolean Phone.GetPlayerPhone = function(src) return exports["gksphone"]:GetPhoneBySource(src) or false end ----comment +---This will send an email to the passed source, email address, title and message. ---@param src number ---@param email string ---@param title string ---@param message string ---@return boolean ----@diagnostic disable-next-line: duplicate-set-field Phone.SendEmail = function(src, email, title, message) local data = {} data.sender = email diff --git a/modules/phone/lb-phone/client.lua b/modules/phone/lb-phone/client.lua index c8dcd2b..6a0cccc 100644 --- a/modules/phone/lb-phone/client.lua +++ b/modules/phone/lb-phone/client.lua @@ -1,13 +1,19 @@ +---@diagnostic disable: duplicate-set-field local resourceName = "lb-phone" if GetResourceState(resourceName) == 'missing' then return end Phone = Phone or {} ----comment +---This will get the name of the Phone system being being used. +---@return string +Phone.GetPhoneName = function() + return resourceName +end + +---This will send an email to the passed email address with the title and message. ---@param email string ---@param title string ---@param message string ----@return nil ----@diagnostic disable-next-line: duplicate-set-field +---@return boolean Phone.SendEmail = function(email, title, message) TriggerServerEvent('community_bridge:Server:genericEmail', {email = email, title = title, message = message}) end diff --git a/modules/phone/lb-phone/server.lua b/modules/phone/lb-phone/server.lua index 90a1cde..0bedbe6 100644 --- a/modules/phone/lb-phone/server.lua +++ b/modules/phone/lb-phone/server.lua @@ -1,19 +1,27 @@ +---@diagnostic disable: duplicate-set-field local resourceName = "lb-phone" if GetResourceState(resourceName) == 'missing' then return end Phone = Phone or {} ----@diagnostic disable-next-line: duplicate-set-field +---This will get the name of the Phone system being being used. +---@return string +Phone.GetPhoneName = function() + return resourceName +end + +---This will get the phone number of the passed source. +---@param src number +---@return number|boolean Phone.GetPlayerPhone = function(src) return exports["lb-phone"]:GetEquippedPhoneNumber(src) or false end ----comment +---This will send an email to the passed source, email address, title and message. ---@param src number ---@param email string ---@param title string ---@param message string ---@return boolean ----@diagnostic disable-next-line: duplicate-set-field Phone.SendEmail = function(src, email, title, message) local numberNumber = exports["lb-phone"]:GetEquippedPhoneNumber(src) if not numberNumber then return false, Prints.Error("Could not Find Phone number") end diff --git a/modules/phone/okokPhone/client.lua b/modules/phone/okokPhone/client.lua index 638b348..0472ca7 100644 --- a/modules/phone/okokPhone/client.lua +++ b/modules/phone/okokPhone/client.lua @@ -1,13 +1,19 @@ +---@diagnostic disable: duplicate-set-field local resourceName = "okokPhone" if GetResourceState(resourceName) == 'missing' then return end Phone = Phone or {} ----comment +---This will get the name of the Phone system being being used. +---@return string +Phone.GetPhoneName = function() + return resourceName +end + +---This will send an email to the passed email address with the title and message. ---@param email string ---@param title string ---@param message string ---@return boolean ----@diagnostic disable-next-line: duplicate-set-field Phone.SendEmail = function(email, title, message) --<-- TODO swap to internal callback system local success = lib.callback.await('community_bridge:Callback:okokPhone:sendEmail', false, email, title, message) --[[ @as boolean ]] diff --git a/modules/phone/okokPhone/server.lua b/modules/phone/okokPhone/server.lua index 27dd81d..1ec524d 100644 --- a/modules/phone/okokPhone/server.lua +++ b/modules/phone/okokPhone/server.lua @@ -1,3 +1,4 @@ +---@diagnostic disable: duplicate-set-field ---@class NewEmail ---@field sender string ---@field recipients string[] @@ -17,21 +18,25 @@ local resourceName = "okokPhone" if GetResourceState(resourceName) == 'missing' then return end Phone = Phone or {} ----comment +---This will get the name of the Phone system being being used. +---@return string +Phone.GetPhoneName = function() + return resourceName +end + +---This will get the phone number of the passed source. ---@param src number ----@return number| boolean ----@diagnostic disable-next-line: duplicate-set-field +---@return number|boolean Phone.GetPlayerPhone = function(src) return exports.okokPhone:getPhoneNumberFromSource(src) or false end ----comment +---This will send an email to the passed source, email address, title and message. ---@param src number ---@param email string ---@param title string ---@param message string ---@return boolean ----@diagnostic disable-next-line: duplicate-set-field Phone.SendEmail = function(src, email, title, message) local senderAddress = exports.okokPhone:getEmailAddressFromSource(src) --[[ @as string? ]] if not senderAddress then return false end diff --git a/modules/phone/qs-smartphone/client.lua b/modules/phone/qs-smartphone/client.lua index 61a23f2..72b1cda 100644 --- a/modules/phone/qs-smartphone/client.lua +++ b/modules/phone/qs-smartphone/client.lua @@ -1,13 +1,19 @@ +---@diagnostic disable: duplicate-set-field local resourceName = "qs-smartphone" if GetResourceState(resourceName) == 'missing' then return end Phone = Phone or {} ----comment +---This will get the name of the Phone system being being used. +---@return string +Phone.GetPhoneName = function() + return resourceName +end + +---This will send an email to the passed email address with the title and message. ---@param email string ---@param title string ---@param message string ----@return nil ----@diagnostic disable-next-line: duplicate-set-field +---@return boolean Phone.SendEmail = function(email, title, message) return true, TriggerServerEvent('qs-smartphone:server:sendNewMail', { sender = email, subject = title, message = message, button = {} }) end diff --git a/modules/phone/qs-smartphone/server.lua b/modules/phone/qs-smartphone/server.lua index 840db7b..fbcc6c9 100644 --- a/modules/phone/qs-smartphone/server.lua +++ b/modules/phone/qs-smartphone/server.lua @@ -1,16 +1,22 @@ +---@diagnostic disable: duplicate-set-field local resourceName = "qs-smartphone" if GetResourceState(resourceName) == 'missing' then return end Phone = Phone or {} ----comment +---This will get the name of the Phone system being being used. +---@return string +Phone.GetPhoneName = function() + return resourceName +end + +---This will get the phone number of the passed source. ---@param src number ----@return number||boolean ----@diagnostic disable-next-line: duplicate-set-field +---@return number|boolean Phone.GetPlayerPhone = function(src) return exports['qs-base']:GetPlayerPhone(src) or false end ----comment +---This will send an email to the passed source, email address, title and message. ---@param src number ---@param email string ---@param title string